<?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: How to write the regex to extract semicolon delimited fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120994#M32523</link>
    <description>&lt;P&gt;Sorry, but it still doesnt work. However, reply from @aljohnson_splunk solved the problem. Thanks to both of you!&lt;/P&gt;</description>
    <pubDate>Wed, 01 Apr 2015 21:17:23 GMT</pubDate>
    <dc:creator>ismarslomic</dc:creator>
    <dc:date>2015-04-01T21:17:23Z</dc:date>
    <item>
      <title>How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120984#M32513</link>
      <description>&lt;P&gt;I have the following log statement, which uses semicolon delimiter and where i want to extract columns as specific fields with use of Regex in IFX. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[1427894078] SERVICE ALERT: example.com ;Current Load;CRITICAL;SOFT;3;CRITICAL - load average: 1.96, 1.29, 0.59
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, I'm not so good at Regex so would need help to create 4 separate regular expressions (will be saved as 4 different fields) which returns following results:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;CODE&gt;[1427894078] SERVICE ALERT: example.com&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;Current Load&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;CRITICAL;SOFT;3&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;CRITICAL - load average: 1.96, 1.29, 0.59&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 01 Apr 2015 20:37:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120984#M32513</guid>
      <dc:creator>ismarslomic</dc:creator>
      <dc:date>2015-04-01T20:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120985#M32514</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "^(?&amp;lt;field1&amp;gt;[^;]+);(?&amp;lt;field2&amp;gt;[^;]+);(?&amp;lt;field3&amp;gt;w+;\w+;\d);(?&amp;lt;field4&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sorry, here's a fixed version (copy/paste it to the end of your search verbatem):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "^(?&amp;lt;field1&amp;gt;[^;]+);(?&amp;lt;field2&amp;gt;[^;]+);(?&amp;lt;field3&amp;gt;[^;]+;[^;]+;[^;]+);(?&amp;lt;field4&amp;gt;.+)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Screenshot: &lt;A href="http://tinypic.com/r/2vj8tvd/8"&gt;http://tinypic.com/r/2vj8tvd/8&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 20:51:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120985#M32514</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-01T20:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120986#M32515</link>
      <description>&lt;P&gt;When I copy/paste &lt;CODE&gt;^(?[^;]+);(?[^;]+);(?w+;\w+;\d);(?.+)&lt;/CODE&gt; in the input field "Regular expression pattern" I get error message&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Invalid regex: syntax error&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;and &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Regex does not extract any named fields.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 01 Apr 2015 21:01:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120986#M32515</guid>
      <dc:creator>ismarslomic</dc:creator>
      <dc:date>2015-04-01T21:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120987#M32516</link>
      <description>&lt;P&gt;Did you include the quotation marks?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 21:05:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120987#M32516</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-01T21:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120988#M32517</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;^(?P&amp;lt;alert&amp;gt;.*?) ;
(?P&amp;lt;stuff&amp;gt;.*?);
(?P&amp;lt;more_stuff&amp;gt;\w+;\w+;\d+);
(?P&amp;lt;ending_stuff&amp;gt;.*)$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is a nice tool for trying it out yourself and testing.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/kC3gH0/1"&gt;https://regex101.com/r/kC3gH0/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 21:07:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120988#M32517</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2015-04-01T21:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120989#M32518</link>
      <description>&lt;P&gt;No. Please see screenshot &lt;A href="http://tinypic.com/r/35i2afs/8"&gt;http://tinypic.com/r/35i2afs/8&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 21:09:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120989#M32518</guid>
      <dc:creator>ismarslomic</dc:creator>
      <dc:date>2015-04-01T21:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120990#M32519</link>
      <description>&lt;P&gt;Edited original post. Retry please.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 21:11:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120990#M32519</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-01T21:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120991#M32520</link>
      <description>&lt;P&gt;No, still same error message.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 21:11:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120991#M32520</guid>
      <dc:creator>ismarslomic</dc:creator>
      <dc:date>2015-04-01T21:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120992#M32521</link>
      <description>&lt;P&gt;Don't use the interactive field extraction. Just add-it onto your search.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 21:13:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120992#M32521</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-01T21:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120993#M32522</link>
      <description>&lt;P&gt;Thanks, this works and solves my need!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 21:16:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120993#M32522</guid>
      <dc:creator>ismarslomic</dc:creator>
      <dc:date>2015-04-01T21:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120994#M32523</link>
      <description>&lt;P&gt;Sorry, but it still doesnt work. However, reply from @aljohnson_splunk solved the problem. Thanks to both of you!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 21:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120994#M32523</guid>
      <dc:creator>ismarslomic</dc:creator>
      <dc:date>2015-04-01T21:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120995#M32524</link>
      <description>&lt;P&gt;Please click "Accept Answer" if this worked&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 21:18:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120995#M32524</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-01T21:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120996#M32525</link>
      <description>&lt;P&gt;I cant accept that comment as answer.. It seems like i need to move it to Reply, but I dont have access to do it&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 21:26:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120996#M32525</guid>
      <dc:creator>ismarslomic</dc:creator>
      <dc:date>2015-04-01T21:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract semicolon delimited fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120997#M32526</link>
      <description>&lt;P&gt;The FIND (match) expression can be the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(.*?);(.*?);(CRITICAL.*?);(CRITICAL.*)$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The REPLACE or EXTRACTION code the next one&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$1\r\n$2\r\n\r\n$3\r\n$4\r\n
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;\r\n&lt;/CODE&gt; standing for &lt;CODE&gt;CR/LF&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;In a PERL-transformation-routine &lt;CODE&gt;\n&lt;/CODE&gt; would be sufficient.&lt;/P&gt;

&lt;P&gt;More details are needed to make a real PERL-transformation-routine out of it.&lt;/P&gt;

&lt;P&gt;You can contact me on romdeclercq at skynet dot be&lt;/P&gt;

&lt;P&gt;Kind Regards, &lt;/P&gt;

&lt;P&gt;Romain. &lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 14:40:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-semicolon-delimited-fields/m-p/120997#M32526</guid>
      <dc:creator>romdece</dc:creator>
      <dc:date>2015-07-17T14:40:01Z</dc:date>
    </item>
  </channel>
</rss>

