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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...