<?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: Extract only first occurrence between two strings in the paragraph of string in splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-first-occurrence-between-two-strings-in-the/m-p/641016#M222096</link>
    <description>&lt;P&gt;I missed the embedded terminator.&amp;nbsp; Use a non-greedy quantifier to stop at the first occurrence.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "scriptnamestart(?&amp;lt;ScriptName&amp;gt;[\w\D]+?)scriptnameend"&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 21 Apr 2023 17:55:35 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2023-04-21T17:55:35Z</dc:date>
    <item>
      <title>How to extract only first occurrence between two strings in the paragraph of string in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-first-occurrence-between-two-strings-in-the/m-p/641003#M222091</link>
      <description>&lt;P&gt;Extract only first occurrence between two strings in the paragraph of string in splunk&lt;/P&gt;
&lt;P&gt;index=perf-*** source=*ResponseDataErrorAnalyzer*&lt;BR /&gt;|rex field=_raw "scriptnamestart(?&amp;lt;ScriptName&amp;gt;[\w\D]+)scriptnameend"&lt;BR /&gt;|table ScriptName&lt;BR /&gt;&lt;BR /&gt;I want to capture the first occurrence an store in the&amp;nbsp; ScriptName&amp;nbsp; and display in the table data&lt;BR /&gt;scriptnamestartreceiving_S02_sat_Getscriptnameend&amp;lt;someText&amp;gt;scriptnamestartReceiving_S02_sat_Getscriptnameend&amp;lt;someText&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 18:15:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-first-occurrence-between-two-strings-in-the/m-p/641003#M222091</guid>
      <dc:creator>rpachamuthu</dc:creator>
      <dc:date>2023-04-21T18:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only first occurrence between two strings in the paragraph of string in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-first-occurrence-between-two-strings-in-the/m-p/641006#M222093</link>
      <description>&lt;P&gt;You have expressed a desire and provided a means to achieve that desire.&amp;nbsp; How did the query fail you?&lt;/P&gt;&lt;P&gt;By default, the &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command will return only the first match.&amp;nbsp; According to regex101.com, your query should return "&lt;SPAN&gt;receiving_S02_sat_Getscriptnameend&amp;lt;someText&amp;gt;scriptnamestartReceiving_S02_sat_Get" from the sample text.&amp;nbsp; Is that not what you want?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 17:01:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-first-occurrence-between-two-strings-in-the/m-p/641006#M222093</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-04-21T17:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only first occurrence between two strings in the paragraph of string in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-first-occurrence-between-two-strings-in-the/m-p/641012#M222094</link>
      <description>&lt;P&gt;The match continues until the second instance of “scriptnameend”. The following pattern uses a lookahead, so it should break at the first instance of “scriptnameend”:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "scriptnamestart(?&amp;lt;ScriptName&amp;gt;.+?(?=scriptnameend))scriptnameend"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I tested the above, it returns “receiving_S02_sat_Get”.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 17:35:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-first-occurrence-between-two-strings-in-the/m-p/641012#M222094</guid>
      <dc:creator>rut</dc:creator>
      <dc:date>2023-04-21T17:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only first occurrence between two strings in the paragraph of string in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-first-occurrence-between-two-strings-in-the/m-p/641016#M222096</link>
      <description>&lt;P&gt;I missed the embedded terminator.&amp;nbsp; Use a non-greedy quantifier to stop at the first occurrence.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "scriptnamestart(?&amp;lt;ScriptName&amp;gt;[\w\D]+?)scriptnameend"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 21 Apr 2023 17:55:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-first-occurrence-between-two-strings-in-the/m-p/641016#M222096</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-04-21T17:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract only first occurrence between two strings in the paragraph of string in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-first-occurrence-between-two-strings-in-the/m-p/641017#M222097</link>
      <description>&lt;P&gt;That's a more effective pattern (148 vs 178 steps), use &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;'s pattern :)!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 18:09:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-only-first-occurrence-between-two-strings-in-the/m-p/641017#M222097</guid>
      <dc:creator>rut</dc:creator>
      <dc:date>2023-04-21T18:09:09Z</dc:date>
    </item>
  </channel>
</rss>

