<?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: max_match resulting in only unique values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-max-match-resulting-in-only-unique-values/m-p/603308#M209968</link>
    <description>&lt;P&gt;If your problem is resolved, then please click the "Accept as Solution" button to help future readers.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2022 00:30:27 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-06-27T00:30:27Z</dc:date>
    <item>
      <title>How to use rex max_match resulting in only unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-max-match-resulting-in-only-unique-values/m-p/603274#M209949</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to get a list of values using max_match=5. &amp;nbsp;However I need the results to only return unique values and not just list 5 values regardless of them being duplicates.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rex max_match=5 (?P&amp;lt;BrandID&amp;gt;(202\d.+?))\"&lt;/LI-CODE&gt;
&lt;P&gt;|table BrandID&lt;/P&gt;
&lt;P&gt;Your help and energy is greatly appreciated. &amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Spencer Neal&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 14:59:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-max-match-resulting-in-only-unique-values/m-p/603274#M209949</guid>
      <dc:creator>spencerneal</dc:creator>
      <dc:date>2022-06-27T14:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: max_match resulting in only unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-max-match-resulting-in-only-unique-values/m-p/603277#M209952</link>
      <description>&lt;P&gt;That's not what &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; does.&amp;nbsp; It just matches patterns.&amp;nbsp; If you need unique results, then insert the &lt;FONT face="courier new,courier"&gt;mvdedup&lt;/FONT&gt; function into your query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;```Get all BrandID values```
| rex max_match=0 (?P&amp;lt;BrandID&amp;gt;(202\d.+?))\"
```Filter out duplicate values ```
| eval BrandID=mvdedup(BrandID)
```Keep only the first 5 unique values```
| eval BrandID=mvindex(BrandID, 0 4)
| table BrandID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jun 2022 00:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-max-match-resulting-in-only-unique-values/m-p/603277#M209952</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-06-26T00:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: max_match resulting in only unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-max-match-resulting-in-only-unique-values/m-p/603307#M209967</link>
      <description>&lt;P&gt;Rich,&lt;/P&gt;&lt;P&gt;Thank you greatly for taking the time to help me out!! &amp;nbsp;:). Your code did the trick!! &amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Please take care.&lt;/P&gt;&lt;P&gt;Spencer&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jun 2022 23:15:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-max-match-resulting-in-only-unique-values/m-p/603307#M209967</guid>
      <dc:creator>spencerneal</dc:creator>
      <dc:date>2022-06-26T23:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: max_match resulting in only unique values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-max-match-resulting-in-only-unique-values/m-p/603308#M209968</link>
      <description>&lt;P&gt;If your problem is resolved, then please click the "Accept as Solution" button to help future readers.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 00:30:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-max-match-resulting-in-only-unique-values/m-p/603308#M209968</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-06-27T00:30:27Z</dc:date>
    </item>
  </channel>
</rss>

