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!

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...

Index This | How many sevens are there between 1 and 100?

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