Splunk Search

How to compare two fields from two indexes and display data when there is a match?

ttchorz
Path Finder

Hi,

I want to compare two fields from two indexes and display data when there is a match.

indexA contains fields plugin_id, plugin_name
indexB contains fields id, solution

I am trying to display plugin_id, plugin_name, solution FOR EVERY RECORD that meets plugin_id=id

So far I have tried these searches but no luck:

(index=indexA OR index=indexB) plugin_id="*" id="*" | where like(plugin_id, id) | table plugin_id, plugin_name, solution

and

(index=indexA OR index=indexB) plugin_id="*" id="*" | where plugin_id=id | table plugin_id, plugin_name, solution
0 Karma

Jeremiah
Motivator

This search should combine the events from the two indexes together by their ID fields, then finds only entries where both id fields are present.

 (index=indexA plugin_id=*) OR (index=indexB id=*) | eval match_id=coalesce(id,plugin_id) | stats values(*) AS * by match_id | search plugin_id=* id=*
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
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 ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...