Splunk Search

Postfix mail delay subsearch

masterpipo
New Member

I need to correlate the delays in mail handling in postfix logs to the sender address. As you know, the line in maillog that holds the delay field is different from the one that holds the from address. I need results something similar to the one below:


| sender address | number of mails delayed | maximum delay |


Since the common values in the mails is the postfix queue id, it's very difficult and can contain a lot of subsearches. I can only correlate 2 of the 3 required fields using 1 subsearch (if delay>60, pass the queue_id to the search on top. I can then get the amount of mails delayed). But correlating the 3rd field is a bit too difficult for me.

Any help is appreciated!

EDIT
I think I got it! Used transaction command to place the fields together and then it sort of worked 🙂

0 Karma

masterpipo
New Member

index="index" host="machine" | rex field=_raw "[^:]+:[^:]+:[^:]+: (?\w+):" | transaction qid keepevicted=true | stats max(delay) by field | sort desc delay | join field [search index="index" host="machine" [search index="index" host="machine" delay>60 | dedup queue_id | fields queue_id] field=* | top field | fields field count]

here's what I got. Hope this helps someone

0 Karma

jonuwz
Influencer

Post some example logs.

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...