Alerting

How to get an alert only when the count is continuously 0 for consecutive 5 minutes?

sahil237888
Path Finder

I want to run a query for every 10 minutes timeframe. But it should alert only when count is continuously 0 for consecutive 5 minutes.

0 Karma

livehybrid
SplunkTrust
SplunkTrust

So, schedule a search that runs every 10 minutes that does this:
index=main
| timechart span=1m dc(src_ip) as testCount
| eval error=IF(testCount>0, 1, 0)
| streamstats window=5 sum(error) as errorSample
| eval alert=IF(errorSample>=5,"ALERT","OKAY")

0 Karma

sahil237888
Path Finder

After 5 , it is not restting the counter.
The counter should be 0 after 5.

0 Karma

sahil237888
Path Finder

_Time Count Counter
17-08-18 8:09 100 0
17-08-18 8:10 500 0
17-08-18 8:11 81 0
17-08-18 8:12 20 0
17-08-18 8:13 56 0
17-08-18 8:14 0 1
17-08-18 8:15 0 2
17-08-18 8:16 0 3
17-08-18 8:17 0 4
17-08-18 8:18 0 5
17-08-18 8:19 789 0
17-08-18 8:20 5 0
17-08-18 8:21 0 1
17-08-18 8:22 0 2
17-08-18 8:23 0 3
17-08-18 8:24 86 0

Here basically the query should check within 10 minutes timeframe.
and If there is continuously 0 in continuous 5 minutes, It should increase counter value to +1 with every occurrence of 0 continuously. The counter will be reset to 0 if there is no 0 in count column.

and should send alert that there is continuous 0 in continuous 5 minutes (it should also show the result at the time the count was 0.

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...