Splunk Search

Find item that are not present in both set

righettod
Engager

Hello,

I try to find the better way in order to apply the search below:

I have 2 set of data and I want to extract the list of item that are not present in both set using and ID field to check the presence.

I have tried "subsearch" command without success.

Do you know any other methods ?

Thanks in advance ;o)

Dominique

Tags (1)
1 Solution

alacercogitatus
SplunkTrust
SplunkTrust

subsearch only searches the main search with the results of the subsearch. You will probably find what you are looking for in the "join" command. So try something like this:

main_search | join ID type=outer [subsearch]|stats count(host) as chost by ID|where chost < 2

This assumes that the events are on two different hosts. You can change the stats to count whatever values you need that shows a successful join.

View solution in original post

righettod
Engager

Thanks you very much ;o)

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

If my answer has solved your question, please check the check mark next to it so that others will know it worked. Thanks.

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

subsearch only searches the main search with the results of the subsearch. You will probably find what you are looking for in the "join" command. So try something like this:

main_search | join ID type=outer [subsearch]|stats count(host) as chost by ID|where chost < 2

This assumes that the events are on two different hosts. You can change the stats to count whatever values you need that shows a successful join.

Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...