Splunk Enterprise

Help with splunk query to alert server status from down to up?

vinothkumark
Path Finder

Hi All,

I have created an alert which checks the status of the server and if it down, then alert will be triggered. 

Query: 
index=performance host=hostname1  source!=sar status!=UP | dedup hostname | table hostname status

Sample Event:
2023-05-10 17:50:18 hostname1 server is DOWN
2023-05-10 17:55:18 hostname2 server is DOWN

Now, I want to create an alert whenever the status changes from DOWN to UP.
Can someone help with query?

Thanks.

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Your requirement is a bit loose.

What you could do is write the current state to a summary index or lookup store and every time you check the status, you compare it to the previous value you saved, then trigger your alert if the status changes.

Alternatively, you could check every 5 minutes looking back say 10 minutes and check whether there is an earlier state that was DOWN and a later state that is UP

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

🍂 Fall into November with a fresh lineup of Community Office Hours, Tech Talks, and Webinars we’ve ...

Transform your security operations with Splunk Enterprise Security

Hi Splunk Community, Splunk Platform has set a great foundation for your security operations. With the ...

Splunk Admins and App Developers | Earn a $35 gift card!

Splunk, in collaboration with ESG (Enterprise Strategy Group) by TechTarget, is excited to announce a ...