Reporting

Is it possible to configure alert emails to be sent out when state changes?

mloon
New Member

At the moment, we get alerts from Splunk when the state is warning/critical. These emails are sent every configured period. Is it possible to configure the alerts so that there is only an email sent when the state changes (eg from normal to warning, from warning to critical, from critical to normal, etc)?

Tags (3)
0 Karma

renjith_nair
SplunkTrust
SplunkTrust

@mloon,

If you have continuous state/status field, use streamstats to get the last status and compare it with the current one.
Try below sample SPL and lets know if it work for you.

|makeresults |eval status="normal,warning,critical,critical,normal,normal"| makemv status delim=","|mvexpand status
|eval _COMMENT="ALL ABOVE IS JUST TO CREATE DUMMY DATA AND NOTHING TO DO WITH ACTUAL SEARCH" 
|reverse|streamstats current=f window=1 last(status) as prev_status|reverse|eval send_alert=if(prev_status==status,0,1)

Based on this alert, you can decide whether you want to send the alert. For eg. |where send_alert==1

Happy Splunking!

horsefez
SplunkTrust
SplunkTrust

Hi @mloon,

please give us some more information about the state changes you are talking about. Do the state changes happen in the eventdata?

We need some sample data before we can help you.

Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...