Splunk Search

How do I get subquery results

bella
Loves-to-Learn Lots

Hi all,
    I have two indexes,  and I want to check whether the data from one index=a exists in the other index=b, and extract the data from the other index=a

 

 

index=a 
id
1
1
2
3
3

index=b
id,name1,name2
1,10,a1
1,9,a2
3,9,a1
4,10,a1
4,12,a2

i want the result=
id,name1,name2
1,10,a1
1,9,a2
3,9,a1

 

 

        Anyone, have a good way to guide
       Thank you!

Labels (2)
Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

index=b [|search index=a | dedup id | table id | format]
0 Karma
Get Updates on the Splunk Community!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...