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!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...