Splunk Search

Why is the updated value for a macro being ignored in the search for a real time alert?

da029jo
Explorer

We are using a macro to maintain a list of hosts that are "under maintenance" and updating the value of this macro using REST.
We use this macro in a real time alert search created to alert us to errors on our servers.

It seems that even though the search works fine when we run it through Splunk Web, the updated macro value is being "ignored" when the alerts are triggered.....

0 Karma
1 Solution

da029jo
Explorer

It seems that the nature of a realtime search, meaning that a thread is "kept open" means that updates to the macro value are not reflected in the alert. This explains the behaviour we were seeing. The resolution we found was to change the alert to be a scheduled search every 1min (for example) and use the @minute-1minute to @minute as the range. This does mean we only get alerts every minute and not "truely" realtime but the solution means the macro value is now reflected so it is an acceptable solution.

View solution in original post

da029jo
Explorer

It seems that the nature of a realtime search, meaning that a thread is "kept open" means that updates to the macro value are not reflected in the alert. This explains the behaviour we were seeing. The resolution we found was to change the alert to be a scheduled search every 1min (for example) and use the @minute-1minute to @minute as the range. This does mean we only get alerts every minute and not "truely" realtime but the solution means the macro value is now reflected so it is an acceptable solution.

sloshburch
Splunk Employee
Splunk Employee

Whoever thought of that solution must be brilliant 😉 Thanks for posting about this!

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Synthetic Monitoring - Resolved Incident on Detector Alerts

We’ve discovered a bug that affected the auto-clear of Synthetic Detectors in the Splunk Synthetic Monitoring ...

Video | Tom’s Smartness Journey Continues

Remember Splunk Community member Tom Kopchak? If you caught the first episode of our Smartness interview ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud? Learn how unique features like ...