<?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: Regex three lines with same format to create three field extractions in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-three-lines-with-same-format-to-create-three-field/m-p/121034#M32541</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your base search | rex "(?i)^LOG (INFO(?:[^:]*:){3}(?P&amp;lt;loginfo&amp;gt;.+)|ERROR(?:[^:]*:){3}(?P&amp;lt;logerror&amp;gt;.+)|EXCEPTION(?:[^:]*:){3}(?P&amp;lt;logexcept&amp;gt;.+))"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 26 Jun 2014 16:01:09 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-06-26T16:01:09Z</dc:date>
    <item>
      <title>Regex three lines with same format to create three field extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-three-lines-with-same-format-to-create-three-field/m-p/121033#M32540</link>
      <description>&lt;P&gt;I am trying to pull specific lines from a log file.  I have a format that is repeated and I have a regex that is pulling the info from those lines.  My problem is that there are 3 lines that have the same format.  I need a way to pull each line separately.  The REGEX I am using for the field extraction looks like this:&lt;/P&gt;

&lt;P&gt;(?i)^(?:[^:]*:){3}(?P[log_error].+) &lt;/P&gt;

&lt;P&gt;The regex works but it is pulling lines that have LOG ERROR, LOG INFO and LOG EXCEPTION.  The logs look like this:&lt;/P&gt;

&lt;P&gt;LOG ERROR:6/6/2014 3:37 PM:&lt;/P&gt;

&lt;P&gt;LOG INFO:6/6/2014 3:37 PM:&lt;/P&gt;

&lt;P&gt;LOG EXCEPTION:6/6/2014 3:37 PM:&lt;/P&gt;

&lt;P&gt;I have tried putting text into the REGEX for each line but I must be inputting something incorrectly.  My goal is to create three field extractions (logerror, loginfo and logexcept).  I know I just need to add a simple text match to the REGEX but I cannot figure out what I am doing wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 15:29:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-three-lines-with-same-format-to-create-three-field/m-p/121033#M32540</guid>
      <dc:creator>Bliide</dc:creator>
      <dc:date>2014-06-26T15:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regex three lines with same format to create three field extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-three-lines-with-same-format-to-create-three-field/m-p/121034#M32541</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your base search | rex "(?i)^LOG (INFO(?:[^:]*:){3}(?P&amp;lt;loginfo&amp;gt;.+)|ERROR(?:[^:]*:){3}(?P&amp;lt;logerror&amp;gt;.+)|EXCEPTION(?:[^:]*:){3}(?P&amp;lt;logexcept&amp;gt;.+))"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Jun 2014 16:01:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-three-lines-with-same-format-to-create-three-field/m-p/121034#M32541</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-26T16:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Regex three lines with same format to create three field extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-three-lines-with-same-format-to-create-three-field/m-p/121035#M32542</link>
      <description>&lt;P&gt;I recommend:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i)^LOG\s*(?P&amp;lt;log_info&amp;gt;[^:]*):(?P&amp;lt;log_date&amp;gt;[^:]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as an automatic field extraction if the events are separated.  Otherwise you need to fix the indexing so that the events are separated.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2015 21:34:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-three-lines-with-same-format-to-create-three-field/m-p/121035#M32542</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2015-06-17T21:34:25Z</dc:date>
    </item>
  </channel>
</rss>

