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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...