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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk Life | Splunk is Officially Part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint. Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...