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