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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...