<?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: Help needed in extracting string between two similar strings in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-needed-in-extracting-string-between-two-similar-strings/m-p/296477#M89459</link>
    <description>&lt;P&gt;Hi Nadal7noval,&lt;BR /&gt;
try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;ERROR&amp;gt;(ERROR:.*cause:\s\[\d+\]\s+){2})
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "(?&amp;lt;ERROR&amp;gt;(ERROR:.*cause:\s\[\d+\]\s+){2})"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;test it at &lt;A href="https://regex101.com/r/rrhW1y/1"&gt;https://regex101.com/r/rrhW1y/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2017 11:39:15 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-10-13T11:39:15Z</dc:date>
    <item>
      <title>Help needed in extracting string between two similar strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-needed-in-extracting-string-between-two-similar-strings/m-p/296476#M89458</link>
      <description>&lt;P&gt;I have a log mentioned below:&lt;/P&gt;

&lt;P&gt;ERROR: Cannot retrieve requested details in 103 ms cause: [50000] ERROR: Building profile failed in 103 ms cause: [000026] ERROR: Cannot build requested profile in 99 ms cause: [5100007] ERROR: Cannot get details for ID : [[ ID ]] cause: Retrieve details failure cause:&lt;/P&gt;

&lt;P&gt;I need to extract the string that starts from 1st "ERROR:" to 2nd "cause:" word.&lt;BR /&gt;
I am using rex field=_raw "(?ERROR.*)cause:"&lt;BR /&gt;
It is giving me complete string till the last cause. Can you help me with rex to stop at 2nd cause:&lt;/P&gt;

&lt;P&gt;Expected result:&lt;BR /&gt;
ERROR: Cannot retrieve requested details in 103 ms cause: [50000] ERROR: Building profile failed in 103 ms &lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 03:10:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-needed-in-extracting-string-between-two-similar-strings/m-p/296476#M89458</guid>
      <dc:creator>Nadal7noval</dc:creator>
      <dc:date>2017-10-13T03:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed in extracting string between two similar strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-needed-in-extracting-string-between-two-similar-strings/m-p/296477#M89459</link>
      <description>&lt;P&gt;Hi Nadal7noval,&lt;BR /&gt;
try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;ERROR&amp;gt;(ERROR:.*cause:\s\[\d+\]\s+){2})
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "(?&amp;lt;ERROR&amp;gt;(ERROR:.*cause:\s\[\d+\]\s+){2})"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;test it at &lt;A href="https://regex101.com/r/rrhW1y/1"&gt;https://regex101.com/r/rrhW1y/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 11:39:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-needed-in-extracting-string-between-two-similar-strings/m-p/296477#M89459</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-10-13T11:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed in extracting string between two similar strings</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-needed-in-extracting-string-between-two-similar-strings/m-p/296478#M89460</link>
      <description>&lt;P&gt;Hi Nadal7noval,&lt;/P&gt;

&lt;P&gt;You can try below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;ERROR&amp;gt;(ERROR:.+?){2})(?=cause\:\s\[)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;ERROR&amp;gt;(ERROR:.+?){2})(?=cause\:)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Oct 2017 13:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-needed-in-extracting-string-between-two-similar-strings/m-p/296478#M89460</guid>
      <dc:creator>jincy_18</dc:creator>
      <dc:date>2017-10-13T13:41:03Z</dc:date>
    </item>
  </channel>
</rss>

