<?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: Has anyone successfully parsed Exim logs into Splunk? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338545#M92722</link>
    <description>&lt;P&gt;I was looking for a head start on this myself when I found your post.&lt;BR /&gt;
I have a new exim4 relay server that I need to monitor.&lt;/P&gt;

&lt;P&gt;Here’s what I came up with myself - wiser spelunkers are welcome to improve on it:&lt;/P&gt;

&lt;P&gt;First, a lot of the fields are parsed automatically by Splunk. That’s because they are name=value pairs. You can find their meanings in the exim4 docs. In Splunk they look like H=xxx, CN=xxx, etc.&lt;BR /&gt;
You can use rename to give the fields friendlier names.&lt;/P&gt;

&lt;P&gt;Here’s an example (your index name is undoubtedly different):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=smtpexim | rename H as HostSender | stats count by HostSender host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is useful for seeing which hosts are using the relay server.&lt;/P&gt;

&lt;P&gt;I also needed to get alerts when there are email transfer failures. Here I needed to combine all the events related to one mail transfer. A good use of transactions. I also had to extract the message id which, strangely enough, is not part of a name value pair. It follows the time stamp in the log.&lt;/P&gt;

&lt;P&gt;This search uses the index and sourcetype I defined. Just substitute here.&lt;BR /&gt;
In actual use I saved the regex as a field extraction after testing it in the search, below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=smtpexim&amp;nbsp;&amp;nbsp;sourcetype=exim4logs | rex field=_raw "^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\s(?P&amp;lt;messageID&amp;gt;.+?)\s.*" |transaction messageID | search NOT Completed AND NOT "queue run"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should not return any events unless a message transfer is not successfully completed. I still haven’t tested it with a bogus message. But I think the Splunk part is good starting point.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Nov 2017 15:47:26 GMT</pubDate>
    <dc:creator>JeffLeshin</dc:creator>
    <dc:date>2017-11-03T15:47:26Z</dc:date>
    <item>
      <title>Has anyone successfully parsed Exim logs into Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338541#M92718</link>
      <description>&lt;P&gt;I'm trying to get Exim logs parsed into Splunk to log inbound/outbound mail.  I'm very new using RegEx and have been fighting to get something to parse it correctly.  I've tried field-extractor and it only grabs about 13%, I've also tried the add-on builder.  &lt;/P&gt;

&lt;P&gt;Has anyone successfully consumed Exim logs?  Can you provide some help?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 14:58:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338541#M92718</guid>
      <dc:creator>ch1221</dc:creator>
      <dc:date>2017-07-31T14:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone successfully parsed Exim logs into Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338542#M92719</link>
      <description>&lt;P&gt;Could you provide some sample data? &lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 19:20:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338542#M92719</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2017-07-31T19:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone successfully parsed Exim logs into Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338543#M92720</link>
      <description>&lt;P&gt;Here is something similar to what I am working with.  As you can see, it includes multiple events in the logs and once those can be separated out, combining the messages with transaction should be straightforward.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2017-06-22 00:00:32 1dNw6R-0004dN-VU &amp;lt;= Yajane_doe@generic.com H=svr-xxx--01.xxx.genericg.com [99.99.99.999] P=esmtp K S=76706 id=d7a4493e0b7e40d29ee9156d95ee9f02@svr-xxx--01.xxx.genericg.com
2017-06-22 00:00:32 H=esa3.generic.iphmx.com [99.99.999.999] F= rejected RCPT : bounce_localunknown router forced verify failure
2017-06-22 00:00:32 1dNw6Q-0004bW-Im =&amp;gt; mumad.atif.b.abd.raz@xx.com.com R=dnslookup T=remote_smtp H=mga14.xx.com.com [99.99.99.999] X=TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256 CV=yes C="250 ok:  Message 227984017 accepted"
2017-06-22 00:00:32 1dNw6Q-0004bW-Im -&amp;gt; amit.radhak@xx.com.com R=dnslookup T=remote_smtp H=mga14.xx.com.com [99.99.99.99] X=TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256 CV=yes C="250 ok:  Message 227984017 accepted"
2017-06-22 00:00:32 1dNw6Q-0004bW-Im -&amp;gt; abhil.bm@xx.com.com R=dnslookup T=remote_smtp H=mga14.xx.com.com [99.99.99.999] X=TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256 CV=yes C="250 ok:  Message 227984017 accepted"
2017-06-22 00:00:32 1dNw6Q-0004bW-Im -&amp;gt; hish.mar.m@xx.com.com R=dnslookup T=remote_smtp H=mga14.xx.com.com [99.99.99.999] X=TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256 CV=yes C="250 ok:  Message 227984017 accepted"
2017-06-22 00:00:32 1dNw6Q-0004bW-Im Completed
2017-06-22 00:00:32 1dNw6R-0004dN-VU =&amp;gt; arn.sine@nmt.com R=dnslookup T=remote_smtp H=aspmx.l.gxxx.com [99.99.99.999] X=TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128 CV=yes K C="250 2.0.0 OK g6si645764iof.8 - gsmtp"
2017-06-22 00:00:32 1dNw6R-0004dN-VU Completed
2017-06-22 00:00:33 no IP address found for host aj.to.genericg.com (during SMTP connection from es3.generic.iphmx.com [99.99.999.999])
2017-06-22 00:00:33 H=esa3.generic.iphmx.com [99.99.999.999] X=TLSv1.2:RC4-SHA:128 CV=no F= temporarily rejected RCPT : lookup of host "aj.to.generic.com" failed in xxx_routes router
2017-06-22 00:00:34 1dNw6U-0004dl-Ia &amp;lt;= error@err.gna.co.jp H=esa2.generic.iphmx.com [99.99.99.99] P=esmtps X=TLSv1.2:RC4-SHA:128 CV=no S=12467 id=1498.114822.305392@err.gna.co.jp
2017-06-22 00:00:35 1dNw6U-0004dl-Ia =&amp;gt; masashi_shigemori@generic.com R=exchange_users T=remote_smtp_ex_hosts H=mail-na.genericg.com [99.99.999.999] X=TLSv1:ECDHE-RSA-AES256-SHA:256 CV=yes K C="250 2.6.0 &amp;lt;1498.114822.305392@err.gna.co.jp&amp;gt; [InternalId=5521513] Queued mail for delivery"
2017-06-22 00:00:35 1dNw6U-0004dl-Ia Completed
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Jul 2017 21:00:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338543#M92720</guid>
      <dc:creator>ch1221</dc:creator>
      <dc:date>2017-07-31T21:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone successfully parsed Exim logs into Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338544#M92721</link>
      <description>&lt;P&gt;Ingesting this sample through the GUI, seems to parse the events OK.  It's also grabbing the timestamp properly.  A good practice would be to take a sample, ingest it through the GUI.  If things aren't linebreaking or timestamping properly, you can make adjustments in the GUI and save the settings in a sourcetype.  Once you have the sourcetype, you can create your input to read the logs in, specifying the new sourcetype you created.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 02:25:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338544#M92721</guid>
      <dc:creator>kmorris_splunk</dc:creator>
      <dc:date>2017-08-18T02:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone successfully parsed Exim logs into Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338545#M92722</link>
      <description>&lt;P&gt;I was looking for a head start on this myself when I found your post.&lt;BR /&gt;
I have a new exim4 relay server that I need to monitor.&lt;/P&gt;

&lt;P&gt;Here’s what I came up with myself - wiser spelunkers are welcome to improve on it:&lt;/P&gt;

&lt;P&gt;First, a lot of the fields are parsed automatically by Splunk. That’s because they are name=value pairs. You can find their meanings in the exim4 docs. In Splunk they look like H=xxx, CN=xxx, etc.&lt;BR /&gt;
You can use rename to give the fields friendlier names.&lt;/P&gt;

&lt;P&gt;Here’s an example (your index name is undoubtedly different):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=smtpexim | rename H as HostSender | stats count by HostSender host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is useful for seeing which hosts are using the relay server.&lt;/P&gt;

&lt;P&gt;I also needed to get alerts when there are email transfer failures. Here I needed to combine all the events related to one mail transfer. A good use of transactions. I also had to extract the message id which, strangely enough, is not part of a name value pair. It follows the time stamp in the log.&lt;/P&gt;

&lt;P&gt;This search uses the index and sourcetype I defined. Just substitute here.&lt;BR /&gt;
In actual use I saved the regex as a field extraction after testing it in the search, below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=smtpexim&amp;nbsp;&amp;nbsp;sourcetype=exim4logs | rex field=_raw "^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\s(?P&amp;lt;messageID&amp;gt;.+?)\s.*" |transaction messageID | search NOT Completed AND NOT "queue run"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should not return any events unless a message transfer is not successfully completed. I still haven’t tested it with a bogus message. But I think the Splunk part is good starting point.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 15:47:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338545#M92722</guid>
      <dc:creator>JeffLeshin</dc:creator>
      <dc:date>2017-11-03T15:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone successfully parsed Exim logs into Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338546#M92723</link>
      <description>&lt;P&gt;I tried to answer this question a little earlier and it seems have failed somehow.&lt;BR /&gt;
If this is ends up being a duplicate, my apologies.&lt;/P&gt;

&lt;P&gt;I was looking for a head start on this myself when I found your post.&lt;BR /&gt;
I have a new exim4 relay server that I need to monitor.&lt;/P&gt;

&lt;P&gt;Here’s what I came up with myself - wiser spelunkers are welcome to improve on it:&lt;/P&gt;

&lt;P&gt;First, a lot of the fields are parsed automatically by Splunk. That’s because they are name=value pairs. You can find their meanings in the exim4 docs. In Splunk they look like H=xxx, CN=xxx, etc.&lt;BR /&gt;
You can use rename to give the fields friendlier names.&lt;/P&gt;

&lt;P&gt;Here’s an example (your index name is undoubtedly different):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=smtpexim | rename H as HostSender | stats count by HostSender host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is useful for seeing which hosts are using the relay server.&lt;/P&gt;

&lt;P&gt;I also needed to get alerts when there are email transfer failures. Here I needed to combine all the events related to one mail transfer. A good use of transactions. I also had to extract the message id which, strangely enough, is not part of a name value pair. It follows the time stamp in the log.&lt;/P&gt;

&lt;P&gt;This search uses the index and sourcetype I defined. Just substitute here.&lt;BR /&gt;
In actual use I saved the regex as a field extraction after testing it in the search, below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=smtpexim&amp;nbsp;&amp;nbsp;sourcetype=exim4logs | rex field=_raw "^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\s(?P&amp;lt;messageID&amp;gt;.+?)\s.*" |transaction messageID | search NOT Completed AND NOT "queue run"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should not return any events unless a message transfer is not successfully completed. I still haven’t tested it with a bogus message. But I think the Splunk part is good start.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 15:56:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Has-anyone-successfully-parsed-Exim-logs-into-Splunk/m-p/338546#M92723</guid>
      <dc:creator>JeffLeshin</dc:creator>
      <dc:date>2017-11-03T15:56:17Z</dc:date>
    </item>
  </channel>
</rss>

