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!

Index This | When is October more than just the tenth month?

October 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

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 ...

What’s New & Next in Splunk SOAR

 Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us for an ...