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!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...