Dashboards & Visualizations

Query which should show whenever there is a modification in data set

Janani_Krish
Path Finder

Hello All,

I have to construct a query whenever there is change in my query result. My query and result is as follows,
Query:
sourcetype="my_sourcetype"|dedup indicator|table indicator

Result:
indicator

a

b

So I need to get an alert whenever my set [Indicator(a,b)] changes, i.e addition [indicator(a,b,c)] or deletion[indicator(a)] happens.
Please suggest for my above requirement.

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

If you only need to worry about additions or deletions then this query should do.

sourcetype="my_sourcetype"
| stats dc(indicator) as count
| where count != 2

Trigger an alert whenever the query returns results.

---
If this reply helps you, Karma would be appreciated.

Janani_Krish
Path Finder

Thanks @richgalloway 
That will help. But is there any way I can identify any modifications in the list, like Indicator[a.b] changed to Indicator[c,d].


0 Karma

richgalloway
SplunkTrust
SplunkTrust

First, you'll need to save the set of expected results.

sourcetype="my_sourcetype"
|dedup indicator
|table indicator
| outputlookup indicator.csv

Then you can compare those results to a new search.

| set diff [sourcetype="my_sourcetype"|dedup indicator|table indicator]
[|inputlookup indicator.csv]
---
If this reply helps you, Karma would be appreciated.
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...