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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...