<?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: ESA field extraction using regex! in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351396#M104002</link>
    <description>&lt;P&gt;Hi kiran331,&lt;/P&gt;

&lt;P&gt;based on the provided examples and based on my assumption that &lt;CODE&gt;field1&lt;/CODE&gt; always has the MID 112011 and &lt;CODE&gt;field2&lt;/CODE&gt; has the MID 221212 you can use this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; MID\s\d+\sto\s\d\s-\s5\.1\.2\s-\s(?&amp;lt;field1&amp;gt;[^\r\n]+)|MID\s\d+\sto\s\d\s-\s5\.4\.7\s-\s(?&amp;lt;field2&amp;gt;[^\r\n]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Updated after comment ...&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2017 20:01:41 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2017-06-12T20:01:41Z</dc:date>
    <item>
      <title>ESA field extraction using regex!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351395#M104001</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;How to extract the field for the below sample ESA logs.&lt;/P&gt;

&lt;P&gt;Sun Jun 11 17:33:36 2017 Info: Double bounce: MID 112011 to 0 - 5.1.2 - Bad destination host 'DNS Hard Error looking up abc.com (MX):  KKDOMAIN'&lt;/P&gt;

&lt;P&gt;Sun Jun 11 10:30:23 2017 Info: Double bounce: MID 221212 to 0 - 5.4.7 - Delivery expired (message too old) [Default] 451-'Open is not allowed please check'&lt;/P&gt;

&lt;P&gt;I need the &lt;/P&gt;

&lt;P&gt;field1="Bad destination host"  &amp;amp; "Delivery expired (message too old) "&lt;/P&gt;

&lt;P&gt;field2="'DNS Hard Error looking up abc.com (MX):  KKDOMAIN" &amp;amp; "Open is not allowed please check"&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 19:23:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351395#M104001</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2017-06-12T19:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: ESA field extraction using regex!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351396#M104002</link>
      <description>&lt;P&gt;Hi kiran331,&lt;/P&gt;

&lt;P&gt;based on the provided examples and based on my assumption that &lt;CODE&gt;field1&lt;/CODE&gt; always has the MID 112011 and &lt;CODE&gt;field2&lt;/CODE&gt; has the MID 221212 you can use this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; MID\s\d+\sto\s\d\s-\s5\.1\.2\s-\s(?&amp;lt;field1&amp;gt;[^\r\n]+)|MID\s\d+\sto\s\d\s-\s5\.4\.7\s-\s(?&amp;lt;field2&amp;gt;[^\r\n]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Updated after comment ...&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 20:01:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351396#M104002</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-06-12T20:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: ESA field extraction using regex!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351397#M104003</link>
      <description>&lt;P&gt;MID will be different for each events, is there a way to get the field values after 5.1.2 - OR 5.4.7-&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 20:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351397#M104003</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2017-06-12T20:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: ESA field extraction using regex!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351398#M104004</link>
      <description>&lt;P&gt;sure, see my updated answer &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 20:21:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351398#M104004</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-06-12T20:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: ESA field extraction using regex!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351399#M104005</link>
      <description>&lt;P&gt;HI Mus, Thanks for the solution. Is there a way to update this for all values not only 5.1.2 Or 5.4.7, it has different values.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 20:54:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351399#M104005</guid>
      <dc:creator>kiran331</dc:creator>
      <dc:date>2017-06-12T20:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: ESA field extraction using regex!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351400#M104006</link>
      <description>&lt;P&gt;If you want to have them all in the same field name, Yes. Otherwise you would have to use different field names and therefore different regex's for each &lt;CODE&gt;5.1.2&lt;/CODE&gt; or &lt;CODE&gt;5.4.7&lt;/CODE&gt; like number. So for example for matches into one field name you can use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; MID\s\d+\sto\s\d+\s-\s\d\.\d\.\d\s-\s(?&amp;lt;field&amp;gt;[^\r\n]+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Jun 2017 21:00:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351400#M104006</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-06-12T21:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: ESA field extraction using regex!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351401#M104007</link>
      <description>&lt;P&gt;or you use &lt;CODE&gt;props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;props.conf&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mySourceType]
REPORT-myDynamicFieldName = myDynamicFieldName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;EM&gt;transforms.conf&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myDynamicFieldName]
REGEX  = MID\s\d+\sto\s\d+\s-\s(\d\.\d\.\d)\s-\s([^\r\n]+)
FORMAT = fieldname_$1::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create a dynamic field name like &lt;CODE&gt;fieldname_5.1.2&lt;/CODE&gt; or &lt;CODE&gt;fieldname_5.4.7&lt;/CODE&gt; in search time ...&lt;BR /&gt;
Maybe this helps?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 21:04:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ESA-field-extraction-using-regex/m-p/351401#M104007</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-06-12T21:04:14Z</dc:date>
    </item>
  </channel>
</rss>

