<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Postfix Logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73714#M18479</link>
    <description>&lt;P&gt;I found that I needed to make one adjustment to your rex.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[^:]+:[^:]+:[^:]+: (?&amp;lt;postfix_id&amp;gt;[A-F0-9]\w+):
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I found that in instances where postfix would warn on bad MX records, the regex was capturing the work "warning" in place of the hexadecimal queue ID for postfix. I updated the regex to only find options with valid hexadecimal values, ensuring that "warning" was not captured.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Mar 2015 19:40:08 GMT</pubDate>
    <dc:creator>dfenko</dc:creator>
    <dc:date>2015-03-23T19:40:08Z</dc:date>
    <item>
      <title>Postfix Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73710#M18475</link>
      <description>&lt;P&gt;I can't wrap my head around how to accomplish this, but postfix logs two separate events for one email. The first event contains the from address:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Feb 17 06:01:44 hostname postfix/qmgr[1544]: DE82B40611: from=&amp;lt;email@domain.com&amp;gt;, size=288, nrcpt=1 (queue active)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The second event contains the to address, status and other goodies:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Feb 17 06:01:45 hostname postfix/smtp[17553]: DE82B40611: to=&amp;lt;email@domain.com&amp;gt;, relay=mx.domain.com[123.123.12.123]:25, delay=30, delays=29/0/0.12/0.27, dsn=2.6.0, status=sent (250 2.6.0 &amp;lt;b36c397a-023f-428b-bd5a-f88c7e80d2a7@mx.domain.com&amp;gt; Queued mail for delivery)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to build a search based on the from address, but do stats on the status (separate counts for deffered, sent, reject etc.). Anyway I could make splunk realize these two events are related?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2012 11:16:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73710#M18475</guid>
      <dc:creator>Will_I_AM</dc:creator>
      <dc:date>2012-02-17T11:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Postfix Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73711#M18476</link>
      <description>&lt;P&gt;You could use the transaction command to build a transaction for these events. I don't have a great deal of experience with Postfix, is the DE82B40611 unique to these events?&lt;/P&gt;

&lt;P&gt;So something you could do to merge these into one event if that is unique to this email is;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;searchterms | rex field=_raw "[^:]+:[^:]+:[^:]+: (?&amp;lt;MaybeUnique&amp;gt;\w+):" | transaction MaybeUnique
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This would produce one event per all events that contain the MaybeUnique field which is the string I mentioned above in extracted form.&lt;/P&gt;

&lt;P&gt;The other option is to do something like;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;searchterms | transaction maxspan=5s startswith=postfix/qmgr* endswith=postfix/smtp*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which should build a transaction based on the contents of the first event matching startswith and the last event in the transaction matching endswith with a max time between events of 5seconds&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2012 11:56:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73711#M18476</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2012-02-17T11:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Postfix Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73712#M18477</link>
      <description>&lt;P&gt;Brilliant and great eye! the DE82B40611 is unique to the messages! so your &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;searchterms | rex field=_raw "[^:]+:[^:]+:[^:]+: (?&amp;lt;MaybeUnique&amp;gt;\w+):" | transaction MaybeUnique
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Works perfectly! From there i just ran it through a where and count by status, here is the full search i ended up with.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=/var/log/maillog | rex field=_raw "[^:]+:[^:]+:[^:]+: (?&amp;lt;MaybeUnique&amp;gt;\w+):" | transaction MaybeUnique | where from="&amp;lt;email@domain.com&amp;gt;" | stats count by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Feb 2012 12:19:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73712#M18477</guid>
      <dc:creator>Will_I_AM</dc:creator>
      <dc:date>2012-02-17T12:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Postfix Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73713#M18478</link>
      <description>&lt;P&gt;No worries, glad its working&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2012 12:55:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73713#M18478</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2012-02-17T12:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Postfix Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73714#M18479</link>
      <description>&lt;P&gt;I found that I needed to make one adjustment to your rex.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[^:]+:[^:]+:[^:]+: (?&amp;lt;postfix_id&amp;gt;[A-F0-9]\w+):
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I found that in instances where postfix would warn on bad MX records, the regex was capturing the work "warning" in place of the hexadecimal queue ID for postfix. I updated the regex to only find options with valid hexadecimal values, ensuring that "warning" was not captured.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2015 19:40:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73714#M18479</guid>
      <dc:creator>dfenko</dc:creator>
      <dc:date>2015-03-23T19:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Postfix Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73715#M18480</link>
      <description>&lt;P&gt;I have same problem. I don't know where I'll ran that command ,I have same problem. I can not solve it. I don't know where it ran&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 10:34:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73715#M18480</guid>
      <dc:creator>abusayeed</dc:creator>
      <dc:date>2018-02-27T10:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Postfix Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73716#M18481</link>
      <description>&lt;P&gt;@abusayeed, You're adding on to a thread that is six years old and already has an accepted answer.  For better chances at a helpful response, please post a new question.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 13:48:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Postfix-Logs/m-p/73716#M18481</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-02-27T13:48:15Z</dc:date>
    </item>
  </channel>
</rss>

