Splunk Search

How to pivot a search off a subsearch result?

Michael
Contributor

Since I couldn't find this anywhere, I'm making my own question and answer, to better help the "next guy" who has this question and can't find the answer either.

I wanted a simple query of an error condition in our email logs, then return the grouped log events associated with that exchange. Since email logs are line by line (multiple events) their only connection is the MID.

Answer below:

0 Karma
1 Solution

Michael
Contributor

index=main [ search index=main (host=esa1* OR host=esa2*) "possible delivery" | stats count by MID | fields + MID | format] | transaction MID

This will search for the error "possible delivery" on a line, then use the MID field to pivot from and collect all the line events from that exchange.

View solution in original post

0 Karma

Michael
Contributor

index=main [ search index=main (host=esa1* OR host=esa2*) "possible delivery" | stats count by MID | fields + MID | format] | transaction MID

This will search for the error "possible delivery" on a line, then use the MID field to pivot from and collect all the line events from that exchange.

0 Karma
Get Updates on the Splunk Community!

Best Strategies to Optimize Observability Costs

 Join us on Tuesday, May 6, 2025, at 11 AM PDT / 2 PM EDT for an insightful session on optimizing ...

Fueling your curiosity with new Splunk ILT and eLearning courses

At Splunk Education, we’re driven by curiosity—both ours and yours! That’s why we’re committed to delivering ...

Splunk AI Assistant for SPL 1.1.0 | Now Personalized to Your Environment for Greater ...

Splunk AI Assistant for SPL has transformed how users interact with Splunk, making it easier than ever to ...