Splunk Search

Two searches and result showing only what is in first but not second search?

zaynaly
Explorer

I have 2 separate searches.

search1 = 17 results
search2 = 20 results

Key column that exists in both searches is "target_id".

How do I show all results containing the target_id that are in search1 but not in search2? How can I solve this using multisearch, join, or subsearch or is there a better way?

Search 2 acts like a a filter.. I dont want to see any results in search1 that has the key column in search2.

Labels (2)
Tags (1)
0 Karma
1 Solution

woodcock
Esteemed Legend

Like this:

<search1> AND NOT [ <search2> | stats count BY target_id | table target_id ]

View solution in original post

woodcock
Esteemed Legend

Like this:

<search1> AND NOT [ <search2> | stats count BY target_id | table target_id ]
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...