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 ]
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...