Splunk 根据价值计算连续事件?

Splunk count consecutive events based on value?

我在这里面临可用性监控问题。我们确实在 splunk 中设置了一个心跳,它告诉应用程序是否已启动,每分钟状态 = 0 或 1。 问题是,有时一个事件会失败(无缘无故,因为该应用程序是 运行),它会降低基于此的应用程序的可用性等级。

是否可以设置一个图表,如果事件没有连续发生 5 次则忽略这些事件?

示例:

_time   Status
00:01   1
00:02   1
00:03   1
00:04   0
00:05   1
00:06   1
00:07   1
00:08   1
00:09   1
00:10   1
00:11   1

如果出现 0,我想检查它是否也出现在之前的 4 个事件中,然后才将其计入我的图表 - 如果没有,我想将其视为误报。

你可以用 streamstats 来做到这一点。

<your existing search>
| streamstats count by Status reset_on_change=true
| where (Status=0 AND count>4)