Splunk Search

How to search unique values in 2 different indexes, compare them, and determine which values are missing from which index?

michael_sleep
Communicator

I've been racking my brain over multi-searches, subsearches, and a few other methods I harvested from Google and Splunk Answers, but so far, I've not been able to find a solution for this.

Scenario:
I have two separate indexes. In both indexes, I have a field called "site" which contains a domain URL. In either one of these indexes, the site value could appear anywhere from not at all to hundreds of times. I need to construct a search that will boil down each index to the unique site URLs that appear in each, then compare the results of both indexes to see if there are URLs that appear in one index and not the other.

The search query does not necessarily need to do show what's missing from both at once, it could be either or, as long as I can modify the search to get the other results I'm looking for. Any idea how to do this?

0 Karma

somesoni2
Revered Legend

We would definitely need a sample search using which you can get site information from each index separately. For now give this a try

index=index1 OR index=index2 | chart dc(site) over site by index | where index1=0 OR index2=0 
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...