Splunk Search

Compare results from two separat search results

Tika
Explorer

I have two separate searches that provides me the same data field in two different fieldds. I want to identify the common items across these two. 

 

search 1 : 

 

`sample_source` earliest=-7d env="test" msg="storage" type="running_services" data="*myservice*" | dedup info.unitId | table info.unitId

 

and search 2 : 

 

`sample_source_2` value="etc" idea="random" earliest=-14d name="*myservice*" | dedup columns.serviceID | table columns.serviceID

 

 

I want to see the common items across these two tables. I looked at similar questions posted here, but they all start with index= , and sourcetype = , I do not know which ones from above maps to which to get index, I am new to splunk. Appreciate any help. Thanks!

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

`sample_source` and `sample_source_2` are macros and possible contain the indexes (and sourcetypes) being used.

If you press <ctrl><shift>E when the search is in the search window, it will produce an expanded version of the search, so you will be able to see what the search macros actually expand to.

Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...