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!

New Year, New Changes for Splunk Certifications

As we embrace a new year, we’re making a small but important update to the Splunk Certification ...

[Puzzles] Solve, Learn, Repeat: Unmerging HTML Tables

[Puzzles] Solve, Learn, Repeat: Unmerging HTML TablesFor a previous puzzle, I needed some sample data, and ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...