Splunk Search

Can I alert when the value of a field changes?

matt
Splunk Employee
Splunk Employee

I've got an application that logs status events. The values in these events generally will not change. Is there a search that will tell me if the value a given field changed from one value (foo=bar) to another (foo=baz)? Kinda like fschange for events

Tags (3)
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

I would alert on the search (over all time):

sourcetype=mystatusevents foo=* | head 2 | dedup consecutive=true foo

and alert if the number of results is more than 1. If you need to be alerted, you should schedule to search to run more frequently than these status events get logged, or you can increase the "head" parameter, e.g., if you make it "| head 20" you need to run the search more frequently than it takes for 19 events to be logged.

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee

I would alert on the search (over all time):

sourcetype=mystatusevents foo=* | head 2 | dedup consecutive=true foo

and alert if the number of results is more than 1. If you need to be alerted, you should schedule to search to run more frequently than these status events get logged, or you can increase the "head" parameter, e.g., if you make it "| head 20" you need to run the search more frequently than it takes for 19 events to be logged.

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