Splunk Enterprise

How to compare a field from different index and display multiple fields from both indexes?

JustAnotherGuy
Observer

I want to compare one field between two index. For example Field A.

index A: Field A, Field B, Field C

index B: Field A, Field D, Field E

Now I want to grab all the data in tabular format as follows:

Field A Field B Field C Field D Field E

 

I tried using join function but the limitation of the join function is that the Field D and Field E are not captured in the search and displayed due to inner join. 

Is there something with full join functionality and displaying the results as displayed when using join function? 

 

My attempt:

index = A sourcetype = A Field H = something | table Field A Field B Field C 
| join Field A [ search index = B sourcetype= B | table Field D Field E ]

Desired result:

Field A Field B Field C Field D Field E

0 Karma

JustAnotherGuy
Observer

Thanks for your prompt response but there seems to be issue with this query:

index = A sourcetype=A FieldH=something 
The above search gives 50 unique values of Field A

index = B sourcetype = B 

This search gives 100 unique values of Field A

 

So using stats by Field A will give those 50 unnecessary values as well. Also, this search will give output for different index in different rows in the table. I want to match Field A in both index and in tabular format want to have everything in one row grouped by Field A.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
(index=A sourcetype=A FieldH=something) OR (index=B sourcetype=B)
| eval inA=if(index=A,1,0)
| stats values(inA) as inA values(FieldB) as FieldB values(FieldC) as FieldC values(FieldD) as FieldD values(FieldE) as FieldE by FieldA
| where inA=1
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Don't use join.  There was a good talk about this at .conf20 this week.  Check it out at conf.splunk.com when it's available.

Use stats to join separate searches.

(index=A sourcetype=A FieldH=something) OR (index=B sourcetype=B)
| stats values(*) as * by FieldA

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...