Alerting

to set an alert if event B doesn't happen post happening of event A

trackvk
New Member

I would like to set up an alert when a HeartBeat MISSED event happens in a log file but HeartBeat REACQUIRED event doesn't happen max within 1min span indicating an issue.

so wanted my search to alert i tried

...|rex "HEARTBEAT\s+(?\S+).*?(?MISSED|REACQUIRED)" | stats latest(_time) AS time latest(action) AS action BY hb | eval age=now()-time | where age>(1*60) AND action=MISSED

Labels (1)
Tags (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Perhaps this will help. It uses dedup to find the most recent action for each hb then keeps only the MISSED actions. Finally, only events older than a minute are kept.

... | rex "HEARTBEAT\s+\S+.*?(?<action>MISSED|REAQUIRED)" 
| dedup hb
| where action="MISSED"
| eval age = now() - _time
| where age > 60
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...