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!

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

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...