Splunk Search

Finding many events not linked to a single end event

jmowat
Engager
I have a bunch of incoming events that either link to a single outcome event or don't link. I'm interested in determining all the events that don't link to the outcome event. For example:

  • Tx 1, event="message_received", id="A"
  • Tx 2, event="message_received", id="A"
  • Tx 3, event="message_received", id="B"
  • Tx 4, event="message_received", id="A"
  • ...
  • Tx 20, event="batch_send_success", id="B"
I would like to run a search to determine which events have not been sent; in the case above, all the events with id="A" do not have a corresponding event="batch_send_success", id="A" event, so I would like to show Tx 1, Tx 2, and Tx 4 in the search.
 
I tried using transaction with keepevicted=true, but that doesn't seem to work for many-to-one linkage transactions like I am trying; it works in reverse and ends up considering all "message_received" with the exception of the most recent one as evicted and gives me false negatives.
 
Thanks in advance for any help!
Labels (1)
Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Try using stats.

index=foo
| stats values(*) as * by id
| where isnull(mvfind(event, "batch_send_success"))

The stats command combines all "event" fields with the same id.  Then mvfind is used to find those that don't contain (returns NULL) "batch_send_success".

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

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Try using stats.

index=foo
| stats values(*) as * by id
| where isnull(mvfind(event, "batch_send_success"))

The stats command combines all "event" fields with the same id.  Then mvfind is used to find those that don't contain (returns NULL) "batch_send_success".

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Routing Data to Different Splunk Indexes in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...

Getting Started with AIOps: Event Correlation Basics and Alert Storm Detection in ...

Getting Started with AIOps:Event Correlation Basics and Alert Storm Detection in Splunk IT Service ...

Register to Attend BSides SPL 2022 - It's all Happening October 18!

Join like-minded individuals for technical sessions on everything Splunk!  This is a community-led and run ...