Splunk Search

Alert when host sends different data in event

rtadams89
Contributor

Every day, a script runs on my Windows boxs that sends an event to Splunk. I'm looking for a search that will return the difference between the most recent event from each host, and the second most recent event from each host.

My hope is that I can create a search that will show me what has changed between the last time the script ran and the previous time the script ran.

Tags (3)
0 Karma

woodcock
Esteemed Legend

Add this to your existing search which is returning your stuff:

... | eventstats dc(linecount) AS numValues by host | where numValues>1
0 Karma

rtadams89
Contributor

"Delta" would not work, as it doesn't take factor in the different hosts. I need to essentially do a "Delta" recursively for each host and then return only those hosts where the delta != 0.

0 Karma

rtadams89
Contributor

Each server sends a list of user accounts (one per line, as a single event) to Splunk. I want to find changes to the users by comparing the previous events to the current events (comparing the linecount value). As a server may not report in each day, I pipe all the events through a "dedup 2 host" command to get a list of the last two events from each host. The results of this (tabled) look like

host | linecount

host1 | 10

host1 | 10

host2 | 3

host2 | 4

host3 | 1

host3 | 1

What I need is a command I can use to return only the "host2" events (as it's the only one that had a change).

0 Karma

lguinn2
Legend

Can you give us a little more info about the events? Also, have you looked at the delta command?
http://docs.splunk.com/Documentation/Splunk/4.2.4/SearchReference/Delta

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Your Feedback. Our Roadmap. Visit the PX Feedback Booth at .conf26

You use Splunk every day, come and help shape what's next.  Save Your Seat: Product-Focused Sessions at ...

Agentic SOC Triage: Investigating Splunk ES Notables with MCP Server and a Local LLM

The Problem: Too Many Alerts, Too Little Context Security operations teams running Splunk Enterprise Security ...

Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas

Watch Now Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas     Do you ever feel ...