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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...