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!

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 ...