Splunk Search

Filtering results based on subsequent events?

Wilcooley
Path Finder

Sorry for the horrible title but I cannot think of a good, succinct description of the problem I am trying to solve (which has also made searching for existing answer difficult).

I am trying to build a table of hosts on where a tool is failing to run; that's easy enough:

 hostA tool failed to run
 hostB tool failed to run
 ...

I build the table with:


"failed to run" | dedup host | table host

But what I've really got is this:

time000 hostA tool failed to run
time001 hostB tool failed to run
 ...
time005 hostA tool run successfully
 ...

So what I'd like to do is exclude hostA, since clearly it is not longer failing, but I am not even sure how to approach this.

Thanks!

Tags (1)
1 Solution

Wilcooley
Path Finder

Ok, I figured this out myself; the trick is to search for both the success and failure messages, dedup based on the host so you get the last of the two messages and then filter those results for the failure message. Something like this:

"failed to run" OR "ran successfully" | dedup host | search "failed to run" |table host

View solution in original post

Wilcooley
Path Finder

Ok, I figured this out myself; the trick is to search for both the success and failure messages, dedup based on the host so you get the last of the two messages and then filter those results for the failure message. Something like this:

"failed to run" OR "ran successfully" | dedup host | search "failed to run" |table host
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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...