Splunk Search

Compare a search with two sources

anmar02930
Engager

I have a search that has "index=A", "Source=A", "Source=B" and both sources have the column "Address"

I want to compare what is in source A but not in Source B based on the Values "Address" 

Labels (3)
0 Karma
1 Solution

yuanliu
SplunkTrust
SplunkTrust

You need to define "compare".  If all that interest you is which addresses are different, it could be as simple as

index=A source IN (A,B) ``` both have common field address ```
| stats values(source) as source by address ``` source is now multivalued ```
| where source == "A" AND source != "B" ``` SPL allows multivalued equality test ```

Hope this helps.

View solution in original post

yuanliu
SplunkTrust
SplunkTrust

You need to define "compare".  If all that interest you is which addresses are different, it could be as simple as

index=A source IN (A,B) ``` both have common field address ```
| stats values(source) as source by address ``` source is now multivalued ```
| where source == "A" AND source != "B" ``` SPL allows multivalued equality test ```

Hope this helps.

Get Updates on the Splunk Community!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...