Splunk Search

How to create a single scheduled search that will trigger an alert only if the current search result differs from the previous result?

bluei
Explorer

Hi,

I have a periodic search looking for a specific pattern in the logs and assign status to the result:

...|eval status=if(count=0,"not found","found")

Is there a way to raise an alert only in the case that the latest search's status value differs from the status returned by the previous one?
I mean, without having two alerts set with different triggers, but based on the same search (which will need to be run twice in this case).

0 Karma
1 Solution

bluei
Explorer

Thank you vganjare,

You gave me the direction which actually led me to an idea to enable summary indexing on this search.
This way I can compare current result with the latest indexed (i.e. previous).

View solution in original post

0 Karma

bluei
Explorer

Thank you vganjare,

You gave me the direction which actually led me to an idea to enable summary indexing on this search.
This way I can compare current result with the latest indexed (i.e. previous).

0 Karma

vganjare
Builder

Hi,

You can use lookups for storing the intermidiate status. Compare the intermidiate result (from lookup) against the current search results. Accordingly, alearts can be triggered.

Thanks!!

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

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 ...