<?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: Mail Journal Header Log in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113203#M29749</link>
    <description>&lt;P&gt;What are your props.conf and transforms.conf settings?&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2015 19:52:06 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2015-05-18T19:52:06Z</dc:date>
    <item>
      <title>Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113198#M29744</link>
      <description>&lt;P&gt;Hi All!&lt;/P&gt;

&lt;P&gt;Today I index a log created from a script that extract some interesting fields from each received (from journaling) mail.&lt;BR /&gt;
This is a CSV log with the interesting fields and their contents separated by ";".&lt;BR /&gt;
I have some issues to work - Ex. a ";" character on the subject.&lt;BR /&gt;
I was looking for a less expensive and more elegant way to do this.&lt;BR /&gt;
I found a less expensive way to export the interesting fields, but it's a multiline log.&lt;BR /&gt;
Here is a piece of the log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Mon, 18 May 2015 17:57:13 +0000
File: /email/1431971833.Vfd04I741e37M920326.lab
Sender: andresn@lab.com
Subject: Proceed to Gate 
To: bhubnr@lab.com
To: ilsonn@lab.com
Cc: clasr@conf.com
Bcc: WLI_GRP@lab.com
Exchange-AuthAs: Internal
originalclientipaddress: 192.168.115.10
Size: 10246
Content-Disposition: False

Mon, 18 May 2015 17:57:02 +0000
File: /email/1431971822.Vfd04I74069fM442554.lab
Sender: paulaugust@lab.com
Subject: Follow up Marine.
To: awelter@lab.com
To: fpacker@info.com
Bcc: WADVENConfCall01@lab.com
Exchange-AuthAs: Internal
originalclientipaddress: 192.168.71.61
Size: 193022
Content-Disposition: True
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Im trying to extract the fields using "rex" but still not running. After found the right regular expression I will add it on transforms.conf&lt;BR /&gt;
The follow expression is OK using the "Extract New Fields" functionality but not on the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "File: (?&amp;lt;FILE&amp;gt;.+) Subject: (?&amp;lt;SUBJECT&amp;gt;.+) Sender: (?&amp;lt;SENDER&amp;gt;.+) Recipient: (?&amp;lt;RCPT&amp;gt;.+) To: (?&amp;lt;TO&amp;gt;.+) Cc: (?&amp;lt;CC&amp;gt;.+) Exchange-AuthAs: (?&amp;lt;AUTH&amp;gt;.+) originalclientipaddress: (?&amp;lt;IP&amp;gt;.+) Size: (?&amp;lt;SIZE&amp;gt;.+) Content-Disposition: (?&amp;lt;ATTACH&amp;gt;.+) Bcc: (?&amp;lt;BCC&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anyone help me please?&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 18:20:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113198#M29744</guid>
      <dc:creator>pierre_weg</dc:creator>
      <dc:date>2015-05-18T18:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113199#M29745</link>
      <description>&lt;P&gt;Extract New Fields leaves a little to be desired.  I found this regex string to work on regex101.com.  Your string had the fields out of order, plus there are multiple To: fields and the Cc: appears to be optional.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "(?gms)File: (?&amp;lt;FILE&amp;gt;.+?)Sender: (?&amp;lt;SENDER&amp;gt;.+?)Subject: (?&amp;lt;SUBJECT&amp;gt;.+?)To: (?&amp;lt;TO&amp;gt;.+?)To: (?&amp;lt;TO2&amp;gt;.+?)(?:Cc: (?&amp;lt;CC&amp;gt;.+?)){0,1}Bcc: (?&amp;lt;BCC&amp;gt;.+?)Exchange-AuthAs: (?&amp;lt;AUTH&amp;gt;.+?)originalclientipaddress: (?&amp;lt;IP&amp;gt;.+?)Size: (?&amp;lt;SIZE&amp;gt;.+?)Content-Disposition: (?&amp;lt;ATTACH&amp;gt;.+?)$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 May 2015 18:48:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113199#M29745</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-05-18T18:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113200#M29746</link>
      <description>&lt;P&gt;Yes, the fields Cc To and Bcc are optional. Just one of them are necessary and I can found more than one of them on a log entry.&lt;BR /&gt;
Splunk do this extraction when indexing Windows Eventlog, but I can't found the way (yet).&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 19:41:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113200#M29746</guid>
      <dc:creator>pierre_weg</dc:creator>
      <dc:date>2015-05-18T19:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113201#M29747</link>
      <description>&lt;P&gt;Perhaps rex is not the best way to do this.  The data is already in keyword:value format so it might be best to let Splunk take it as it will.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 19:44:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113201#M29747</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-05-18T19:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113202#M29748</link>
      <description>&lt;P&gt;Sure, but Splunk is not doing the work.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 19:50:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113202#M29748</guid>
      <dc:creator>pierre_weg</dc:creator>
      <dc:date>2015-05-18T19:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113203#M29749</link>
      <description>&lt;P&gt;What are your props.conf and transforms.conf settings?&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 19:52:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113203#M29749</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-05-18T19:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113204#M29750</link>
      <description>&lt;P&gt;props.conf&lt;BR /&gt;
    [MailHeader]&lt;BR /&gt;
    NO_BINARY_CHECK = 1&lt;BR /&gt;
    pulldown_type = 1&lt;BR /&gt;
    CHECK_FOR_HEADER = false&lt;BR /&gt;
    REPORT-AutoHeader = MailHeader&lt;/P&gt;

&lt;P&gt;Nothing on Transforms.conf&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:58:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113204#M29750</guid>
      <dc:creator>pierre_weg</dc:creator>
      <dc:date>2020-09-28T19:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113205#M29751</link>
      <description>&lt;P&gt;You'll want to add &lt;CODE&gt;KV_MODE=none&lt;/CODE&gt; to props.conf and create a MailHeader stanza in transforms.conf.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MailHeader]
MV_ADD = true
REGEX=(?gms)File: (.+?)Sender: (.+?)Subject: (.+?)To: (.+?)To: (.+?)(?:Cc: (.+?)){0,1}Bcc: (.+?)Exchange-AuthAs: (.+?)originalclientipaddress: (.+?)Size: (.+?)Content-Disposition: (.+?)$
FORMAT = FILE::$1 SENDER::$2 SUBJECT:$3 TO::$4 TO2$5 CC::$6 BCC::$7 AUTH::$8 IP::$9 SIZE::$10 ATTACH::$11
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 May 2015 20:30:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113205#M29751</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-05-18T20:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113206#M29752</link>
      <description>&lt;P&gt;No way... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
I try using "SHOULD_LINEMERGE = true" and "BREAK_ONLY_BEFORE = ^$" to, but not working.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:58:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113206#M29752</guid>
      <dc:creator>pierre_weg</dc:creator>
      <dc:date>2020-09-28T19:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113207#M29753</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "File: (?&amp;amp;lt;FILE&amp;amp;gt;.+)"| rex "Subject: (?&amp;amp;lt;SUBJECT&amp;amp;gt;.+)"| rex "Sender: (?&amp;amp;lt;SENDER&amp;amp;gt;.+)"| rex "Recipient: (?&amp;amp;lt;TO&amp;amp;gt;.+)"| rex "To: (?&amp;amp;lt;TO&amp;amp;gt;.+)"| rex "Cc: (?&amp;amp;lt;CC&amp;amp;gt;.+)"| rex "Exchange-AuthAs: (?&amp;amp;lt;AUTH&amp;amp;gt;.+)"| rex "originalclientipaddress: (?&amp;amp;lt;IP&amp;amp;gt;.+)"| rex "Size: (?&amp;amp;lt;SIZE&amp;amp;gt;.+)"| rex "Content-Disposition: (?&amp;amp;lt;ATTACH&amp;amp;gt;.+)"| rex "Bcc: (?&amp;amp;lt;BCC&amp;amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search string produce my desired results, but I want to do using props and transforms.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 10:44:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113207#M29753</guid>
      <dc:creator>pierre_weg</dc:creator>
      <dc:date>2015-05-19T10:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113208#M29754</link>
      <description>&lt;P&gt;I'm afraid I'm out of suggestions.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 12:02:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113208#M29754</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-05-19T12:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113209#M29755</link>
      <description>&lt;P&gt;thanks by the effort&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 12:37:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113209#M29755</guid>
      <dc:creator>pierre_weg</dc:creator>
      <dc:date>2015-05-19T12:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Mail Journal Header Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113210#M29756</link>
      <description>&lt;P&gt;I get my answer opening a support case.&lt;/P&gt;

&lt;P&gt;You can add &lt;STRONG&gt;max_match&lt;/STRONG&gt; to the rex. For example,&lt;/P&gt;

&lt;P&gt;|rex field=_raw "File: (?.+)"| rex "Subject: (?.+)"| rex "Sender: (?.+)"| rex "Recipient: (?.+)"| rex "To: (?.+)" max_match=3| rex "Cc: (?.+)"| rex "Exchange-AuthAs: (?.+)"| rex "originalclientipaddress: (?.+)"| rex "Size: (?.+)"| rex "Content-Disposition: (?.+)"| rex "Bcc: (?.+)"&lt;/P&gt;

&lt;P&gt;In order to capture all the fields that had multiple values (such as the To: and Cc: fields), I set the following up: &lt;/P&gt;

&lt;P&gt;props.conf: &lt;BR /&gt;
[test-240026] &lt;BR /&gt;
REPORT-logextracts = extractions &lt;/P&gt;

&lt;P&gt;Then in transforms.conf I had the following: &lt;BR /&gt;
[extractions] &lt;BR /&gt;
REGEX=([^:]+):([^\r\n]+) &lt;BR /&gt;
FORMAT=$1::$2 &lt;BR /&gt;
MV_ADD = true &lt;/P&gt;

&lt;P&gt;That worked good...except for the first line of the entries which was the date/time stamp. &lt;/P&gt;

&lt;P&gt;It made a field named "Tue, 19 May 2015 13" with a value of "47:05 +0000" - which isn't really what we wanted. &lt;/P&gt;

&lt;P&gt;So I added a sedcmd to modify the date line as it got indexed. I changed it from "Tue, 19 May 2015 13:40:43 +0000" to "Timestamp: Tue, 19 May 2015 13:40:43 +0000". &lt;/P&gt;

&lt;P&gt;So, now it'll extract a field called "Timestamp" with a value of "Tue, 19 May 2015 13:40:43 +0000". &lt;/P&gt;

&lt;P&gt;So now that we got that working, we can turn on MV_ADD=true in the transforms.conf. That'll take any other matches it finds and make a multi-value for it. So if it encounters multiple To: values in one event, it'll collect them all. &lt;/P&gt;

&lt;P&gt;Here's the full props.conf: &lt;BR /&gt;
[test-240026] &lt;BR /&gt;
REPORT-logextracts = extractions &lt;BR /&gt;
SEDCMD-fixdateline = s/(^[\w]{3},\s+[\d]{2}\s+[\w]{3}\s+[\d]{4}\s[\d]{2}:[\d]{2}:[\d]{2}\s+[\d]{4})/Timestamp: \1/g &lt;/P&gt;

&lt;P&gt;Transforms.conf: &lt;BR /&gt;
[extractions] &lt;BR /&gt;
REGEX=([^:]+):([^\r\n]+) &lt;BR /&gt;
FORMAT=$1::$2 &lt;BR /&gt;
MV_ADD = true &lt;/P&gt;

&lt;P&gt;Thanks Brian for the support.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:04:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Mail-Journal-Header-Log/m-p/113210#M29756</guid>
      <dc:creator>pierre_weg</dc:creator>
      <dc:date>2020-09-28T20:04:29Z</dc:date>
    </item>
  </channel>
</rss>

