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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...