Splunk Search

How to compare values in fields from 2 indexes?

Luninho
Explorer

I have 2 indexes: index1 and index2. I need to compare values in both indexes and show only differences in fields. In both indexes always exist the same field - time, so I need match by this field.

For example:

Index1
Time - 26.11.20
Field1 - xxxx
Field2 - xxxx

and

Index2
Time - 26.11.20
Field1 - xxxx
Field2 - xxxy

I want to get a table:

Field2 - xxxx
Field2 - xxxy

Labels (1)
Tags (1)
0 Karma

to4kawa
Ultra Champion
| makeresults
| eval Time="26.11.20",Field1="xxxx",Field2="xxxx"
| appendpipe [eval Time="26.11.20",Field1="xxxx",Field2="xxxy"]
| rename COMMENT as "From here, the logic"
| untable Time Field Value
| stats values(Value) as Value by Time Field
| where mvcount(Value)=2
| xyseries Time Field Value
0 Karma
Get Updates on the Splunk Community!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...