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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...