在splunk中如何对splunk应用多个过滤器

问题描述 投票:0回答:1

在splunk中,如果我们想添加多个过滤器,我们如何轻松地做到这一点?例如:-

index = indexer action = Null NOT IP IN(10.34.67.32,87.90.32.10。依此类推)

现在的问题是我是否要从结果中排除519个IP,我们如何才能轻松做到这一点。

我已经尝试过下面的代码,但是编写查询花费了更多时间

索引=索引器操作=空IP!= 10.34.67.32 IP!= 87.90.32.10等。

splunk splunk-query splunk-formula
1个回答
0
投票

我建议您创建一个要从搜索中排除的IP的CSV文件。

IP
10.34.67.32
87.90.32.10
...

使用此文件作为源创建查找(请参考https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Usefieldlookupstoaddinformationtoyourevents)。让我们称之为查找excluded_ips

现在,您可以进行以下搜索以从该文件中排除IP

index=indexer action= Null NOT [ | inputlookup excluded_ips | fields IP | format ]

format命令将IP列表更改为((IP=10.34.67.32) OR (IP=87.90.32.10))。因此,展开运行的扩展搜索为

index=indexer action= Null NOT ((IP=10.34.67.32) OR (IP=87.90.32.10))
© www.soinside.com 2019 - 2024. All rights reserved.