<?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: Rex Question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175959#M50530</link>
    <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ^:(?P&amp;lt;error&amp;gt;.*)$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if the complete string you're looking at is ":test string 123:test test test123" and you just want to remove the ":" this works.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Aug 2015 14:00:49 GMT</pubDate>
    <dc:creator>diogofgm</dc:creator>
    <dc:date>2015-08-17T14:00:49Z</dc:date>
    <item>
      <title>Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175956#M50527</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;rex "(?i)(?P&amp;lt;testERROR&amp;gt;(\:[^\:]*){2})$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;output&lt;/P&gt;

&lt;P&gt;:test string 123:test test test123&lt;/P&gt;

&lt;P&gt;I have to keep the the 2nd : match from the end of the line but i don't want it to be displayed in the output.&lt;BR /&gt;&lt;BR /&gt;
*when i say second  match from the end, that means i would like to remove the colon from ":test"&lt;/P&gt;

&lt;P&gt;Is this something where a lookahead/lookbehind is needed? &lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 13:21:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175956#M50527</guid>
      <dc:creator>subtrakt</dc:creator>
      <dc:date>2015-08-17T13:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175957#M50528</link>
      <description>&lt;P&gt;is ":test string 123:test test test123" the string you want to use that regex?&lt;BR /&gt;
if it is, you are capturing 2 groups&lt;/P&gt;

&lt;P&gt;group "testERROR" - :test string 123:test test test123&lt;BR /&gt;
unnamed group - :test test test123&lt;/P&gt;

&lt;P&gt;what do you want to capture? this? "test test test123"&lt;/P&gt;

&lt;P&gt;use &lt;A href="https://regex101.com"&gt;https://regex101.com&lt;/A&gt; to test your regex&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 13:50:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175957#M50528</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2015-08-17T13:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175958#M50529</link>
      <description>&lt;P&gt;test string 123:test test test123&lt;BR /&gt;
this is what i want to capture. &lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 13:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175958#M50529</guid>
      <dc:creator>subtrakt</dc:creator>
      <dc:date>2015-08-17T13:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175959#M50530</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ^:(?P&amp;lt;error&amp;gt;.*)$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if the complete string you're looking at is ":test string 123:test test test123" and you just want to remove the ":" this works.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 14:00:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175959#M50530</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2015-08-17T14:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175960#M50531</link>
      <description>&lt;P&gt;If you are asking how to capture everything after the next-to-last colon (through the end of the line) but don't include the next-to-last colon, then do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex ":(?&amp;lt;testERROR&amp;gt;[^:]*:[^:]*$)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Aug 2015 16:02:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175960#M50531</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-17T16:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175961#M50532</link>
      <description>&lt;P&gt;I guess the quantifier wasn't needed.  Thanks Woodcock!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2015 20:43:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175961#M50532</guid>
      <dc:creator>subtrakt</dc:creator>
      <dc:date>2015-08-18T20:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175962#M50533</link>
      <description>&lt;P&gt;If this worked, do click "Accept" to close the question.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2015 01:09:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/175962#M50533</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-19T01:09:09Z</dc:date>
    </item>
  </channel>
</rss>

