Splunk Search

How to compare different fields having the same value in different events?

pratibha2018
Explorer

How to compare different fields having the same value and though in different events?
For example : index1, source1, sourcetype1 has "n" events and index2, source2, sourcetype2 has "m" events .
Now, some fields from sourcetype1(say field1) have the same values as that of some fields of sourcetype2(sayfield2).
I want for field1=field2 list all the other fields of sourcetype2,sourcetype1. The thing is that I have to compare it in different events.
Not a single event is having both field1 and field2.

0 Karma
1 Solution

tiagofbmm
Influencer

Hi

Try this and let me know please

index2 source2 sourcetype2
 [ search index1 source1 sourcetype1 | dedup field1 | return 1000 field2=field1 ]
|  fields - field2

View solution in original post

0 Karma

tiagofbmm
Influencer

Hi

Try this and let me know please

index2 source2 sourcetype2
 [ search index1 source1 sourcetype1 | dedup field1 | return 1000 field2=field1 ]
|  fields - field2
0 Karma

pratibha2018
Explorer

It worked.

Many thanks!

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...