Splunk有趣的字段排除

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

我有4个领域(Name , age, class, subject)中的一个索引(Student_Entry),我想添加总的事件,但我想排除那些在主题字段中有任何值的事件。

我尝试了以下两种方法

index=Student_Entry   Subject !=* | stats count by event
index=Student_Entry   NOT Subject= * | stats count by event
splunk splunk-query splunk-sdk splunk-calculation
1个回答
2
投票

NOT!= 操作符类似,但不等同。 NOT 将返回主题字段中没有值的事件,而 != 不会。 在您的情况下,使用 !=. 见 https:/docs.splunk.comDocumentationSplunk8.0.4SearchNOTexpressions。

stats count by event 什么都不做,因为没有名为'event'的字段。 要计算事件,只需使用 stats count.


0
投票

看来你用的是正确的 index=Student_Entry Subject !=*

那么你可以只加- | stats count


0
投票

你也可以这样做。

index=Student_Entry
| where isnull(subject)
| stats count
© www.soinside.com 2019 - 2024. All rights reserved.