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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...