All Apps and Add-ons

How to create an alert if a switch is disabled for more than 10 min?

pp1231234
Engager

Hi all,

I am currently working on creating an alert to notify if the status of a switch is disable for more than 10 min, common scenario is that switches disconnect for a min and would be back to running, we would only like to target the ones whose status remains disconnected for more than 10 min.

Below is the sample log:

Apr 18 07:46:25 hostname tag=abc CEF:0Agent status changed|Status of agent "name" at IP "ip address" (id=10,0) changed from running to disabled
Apr 11 07:50:10 hostname tag=abc CEF:0Agent status changed|Status of agent "name" at IP "ip address" (id=10,0) changed from disabled to Running
Tags (2)
0 Karma

woodcock
Esteemed Legend

Like this:

...
| rex "changed from (?<transition>.*)"
| streamstats count(eval(transition="disabled to Running")) AS sessionID BY host
| stats first(_time) AS _time count dc(transition) AS transitionCount values(transition) AS transition BY sessionID host
| where transitionCount==1 AND transition="running to disabled" AND _time <= relative_time(now(), "-10m")
0 Karma
Get Updates on the Splunk Community!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...