Splunk Search

use query as a lookup for value

leonardr
New Member

within an index i have Records with a Name and Id and some with just the ID.

sourcetype=A Name="Foo" Id=23
sourcetype=A Name="Blah" Id=24
sourcetype=B Id = 24 Message="Found"
sourcetype=B Id =23 Message="Lost"
sourcetype=B Id=24 Message="Lost"

I am looking to query and get

Name="Foo" Id=23 Message="Lost"
Name="Blah" Id=24 Message="Found"
Name="Blah" Id=24 Message="Lost"

basically wanting to use source a as a lookup i have tried join the syntaxes but no luck

Tags (1)
0 Karma

somesoni2
Revered Legend

Try like this

sourcetype=A OR sourcetype=B | stats values(Name) as Name values(Message) as Message by Id
0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...