繁体   English   中英

Splunk-仅当搜索字段在查找表中包含单词时如何获取结果

[英]Splunk - How to get results only if search field contains a word in the lookup table

如果我有一个搜索结果,其中包含一个名为“ Field1”的字段,并且其值类似于:

现在是Word1。

现在是Word2。

现在是WordX。

现在是WordZ。

下面是Word的查询表。

场1

Word1

Word2

Word3

Word4

Word5

Word6

我该如何搜索,以便仅在输出结果下方显示,因为它们包含查找表中的“ Word1”和“ Word2”?

现在是Word1。

现在是Word2。

一种方法是在子搜索中读取查找文件。

index=foo [ | inputlookup words.csv | format ]

format命令将查找文件的内容设置为field = value格式,因此最终查询将变为index=foo ((field1=Word1) OR (field1=Word2))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM