如何在Splunk中查找重复的日志事件



我试图查询我的Splunk日志以查找重复的数据,但找不到正确的查询。

日志示例:

{"time":"2021-07-08 02:16:17.9232","level":"debug","message":"update","parameters":{"id":["1"], other params...}}
{"time":"2021-07-08 02:17:17.9232","level":"debug","message":"update","parameters":{"id":["1"], other params...}}

重复的日志事件将具有相同的id参数,但时间戳不同。

一旦提取了所需字段,查找重复项就是对该字段的每个值的实例进行计数,并显示计数大于1的实例。

index=foo
| spath
| stats count by "parameters.id"
| where count > 1

最新更新