<?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 Rex not stopping capture after match in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-not-stopping-capture-after-match/m-p/678025#M231876</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I'm not sure why rex is properly matching the beginning of the value I am looking for (NameofTeam), but it also matches and includes everything after it. As I understand it, my search should stop matching when it reaches&amp;nbsp;"}, after matching the team name. What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test | rex field=_raw "Key\": \"Owner\", \"ValueString\": \"(?&amp;lt;Team&amp;gt;.+)\"},"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sample Data:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"Key": "OtherKey", "ValueString": "OtherValue"}, {"Key": "Owner", "ValueString": "NameofTeam"}, {"Key": "OtherKey", "ValueString": "OtherValue"},&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Expected Output:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NameofTeam&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Actual Output:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NameofTeam"}, {"Key": "OtherKey", "ValueString": "OtherValue"},&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Feb 2024 07:44:50 GMT</pubDate>
    <dc:creator>ea-2023</dc:creator>
    <dc:date>2024-02-22T07:44:50Z</dc:date>
    <item>
      <title>Rex not stopping capture after match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-not-stopping-capture-after-match/m-p/678025#M231876</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm not sure why rex is properly matching the beginning of the value I am looking for (NameofTeam), but it also matches and includes everything after it. As I understand it, my search should stop matching when it reaches&amp;nbsp;"}, after matching the team name. What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test | rex field=_raw "Key\": \"Owner\", \"ValueString\": \"(?&amp;lt;Team&amp;gt;.+)\"},"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sample Data:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"Key": "OtherKey", "ValueString": "OtherValue"}, {"Key": "Owner", "ValueString": "NameofTeam"}, {"Key": "OtherKey", "ValueString": "OtherValue"},&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Expected Output:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NameofTeam&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Actual Output:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NameofTeam"}, {"Key": "OtherKey", "ValueString": "OtherValue"},&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 07:44:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-not-stopping-capture-after-match/m-p/678025#M231876</guid>
      <dc:creator>ea-2023</dc:creator>
      <dc:date>2024-02-22T07:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rex not stopping capture after match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-not-stopping-capture-after-match/m-p/678034#M231877</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;+&lt;/FONT&gt; quantifier is greedy, meaning it will match as many characters as possible.&amp;nbsp; So you'll get everything from NameofTeam until the end of the data.&amp;nbsp; To avoid that, use the non-greedy quantifier &lt;FONT face="courier new,courier"&gt;+?&lt;/FONT&gt;, even better, change the pattern to match until the next quotation mark.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test | rex field=_raw "Key\": \"Owner\", \"ValueString\": \"(?&amp;lt;Team&amp;gt;.+?)\"},"&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;index=test | rex field=_raw "Key\": \"Owner\", \"ValueString\": \"(?&amp;lt;Team&amp;gt;[^"]+)\"},"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 01:42:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-not-stopping-capture-after-match/m-p/678034#M231877</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-02-20T01:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Rex not stopping capture after match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-not-stopping-capture-after-match/m-p/678116#M231907</link>
      <description>&lt;P&gt;The first one did end up working for me. The second one for whatever reason was throwing&amp;nbsp;&lt;EM&gt;Error in 'SearchParser': Mismatched ']'.&lt;/EM&gt;&amp;nbsp;Not a big deal for me since the first one works, but figured I'd mention it.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "Key\": \"Owner\", \"ValueString\": \"(?&amp;lt;Owner&amp;gt;[^"])\"},"&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;The second one is what I thought I was doing... capturing everything until it saw &lt;EM&gt;"},&amp;nbsp; &amp;nbsp;&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you for helping me with this!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 18:33:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-not-stopping-capture-after-match/m-p/678116#M231907</guid>
      <dc:creator>ea-2023</dc:creator>
      <dc:date>2024-02-20T18:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rex not stopping capture after match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-not-stopping-capture-after-match/m-p/678187#M231938</link>
      <description>&lt;P&gt;The second &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command probably needs additional escaping, but since the first works for you we'll leave it at that.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 13:24:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-not-stopping-capture-after-match/m-p/678187#M231938</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-02-21T13:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rex not stopping capture after match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-not-stopping-capture-after-match/m-p/678208#M231942</link>
      <description>&lt;P&gt;You can try this regex also :&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Key":\s*"Owner",\s*"ValueString":\s*"(?&amp;lt;Team_Name&amp;gt;[^"]*)"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Regex" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29424iB83329E6B701346B/image-size/large?v=v2&amp;amp;px=999" role="button" title="regex.png" alt="Regex" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Regex&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 15:42:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-not-stopping-capture-after-match/m-p/678208#M231942</guid>
      <dc:creator>kiran_panchavat</dc:creator>
      <dc:date>2024-02-21T15:42:28Z</dc:date>
    </item>
  </channel>
</rss>

