Alerting

Multiple condition checks before sending alert

chandukreddi
Path Finder

hello Team,

 

We have alert which finds the string 'is now DOWN'  and then send the alert but we realized that after few seconds to few mins the node is coming up, so we want to get the alert if the node doesn't come up after 5 mins, can any one help us?

We want to get alert with below flow

 

search string 'is now DOWN'

condition: and check string '10.83.29.240 is now UP' about next 5 mins before sending alert

 

Logprints:

INFO [GossipTasks:1] 2020-06-30 01:42:40,115 Gossiper.java:1041 - InetAddress /10.83.29.240 is now DOWN

INFO [SharedPool-Worker-4] 2020-06-30 01:42:51,401 Gossiper.java:1026 - InetAddress /10.83.29.240 is now UP

 

As you see after 2 seconds that node came up.

 

Thanks

Chandra

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Something like this should do it.  It pulls all up and down events and extracts the state into a field.  Then the most recent state for each server is saved and those which are down for more than 5 minutes are returned.

index=foo ("is now DOWN" OR "is now UP")
| rex "is now (?<state>\w+)"
| stats latest(state) as state by InetAddress
| where (state="DOWN" AND _time<=relative_time(now(), "-5m")

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Something like this should do it.  It pulls all up and down events and extracts the state into a field.  Then the most recent state for each server is saved and those which are down for more than 5 minutes are returned.

index=foo ("is now DOWN" OR "is now UP")
| rex "is now (?<state>\w+)"
| stats latest(state) as state by InetAddress
| where (state="DOWN" AND _time<=relative_time(now(), "-5m")

 

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...