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

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...