Splunk Search

How to use join command to keep events from subsearch that do not match with parent search?

sloshburch
Splunk Employee
Splunk Employee

My understanding of the documentation (and my experiments) is that the inner keeps only events that match both searches, left keeps matches as well as items that were in the parent search but not in the child search, and outer keeps ONLY events that did not match from both searches. Unfortunately, I can't figure out how to keep items from the subsearch.

The search that I have set as the parent search returns more than 50k events and therefore can't be the subsearch.

Any ideas how to use the join command where the search keeps any events from the subsearch that do not have matches with the parent?

Tags (3)
1 Solution

somesoni2
Revered Legend

You might be able to do it without join (using stats). Could you provide your two searches?

View solution in original post

strive
Influencer
0 Karma

somesoni2
Revered Legend

You might be able to do it without join (using stats). Could you provide your two searches?

sloshburch
Splunk Employee
Splunk Employee

Thanks. That is exactly how I interpreted your tip. Ideally I get them on the same initial search but at the least I think I'll be all set using stats. Thanks again!

0 Karma

somesoni2
Revered Legend

Just for reference (see 2nd answer) http://answers.splunk.com/answers/81741/full-outer-join

0 Karma

sloshburch
Splunk Employee
Splunk Employee

Yes! Stats! I think that's the way to go. Then I can use something simple like a | fields just the stuff to keep | stats latest(*) as * by unique1 unique2

Good idea!

I can't really share the actual search - they are derived from a massive amount of macros and I'm concerned they exposes a little more about the business than I'm comfortable with.

The stats is a great idea - exactly what I was looking for - a way to approach this from another direction. Thanks again.

Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...