Splunk Search

How to include values from a search in a subsearch?

jakewhittet
Explorer

I have some ironport logs that I am trying to tie together within Splunk without much success.

Currently I have a search that will return MID and ICID values. I would then like to get further events that match those field values. I have done this successfully using the map command, using something like the below.

index=someindex sourcetype=somesourcetype sender="some@sender.com" 
| map search="search index=someindex sourcetype=somesourcetype (mid=$mid$ OR icid=$icid$)" 

The issue I am now facing is that sometimes the MID values get rewritten, so I also need to run another search that will get events that match the new rewritten MID value. I have tried various different subsearches and joins, including trying the appendpipe command, but have been unable to pull the other events.

Eventually once I've got all the relevant events, I want to pipe those values into a stats command to group by time or some other field.

Any help is much appreciated.

Tags (1)
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!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

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