<?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: How to find the most matching result? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-matching-result/m-p/257945#M77272</link>
    <description>&lt;P&gt;Use the regex command:&lt;/P&gt;

&lt;P&gt;... | regex aaaaa-bbbbb-ccccc&lt;/P&gt;

&lt;P&gt;Etc&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.4.3/SearchReference/Regex"&gt;https://docs.splunk.com/Documentation/Splunk/6.4.3/SearchReference/Regex&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 03 Sep 2016 11:46:07 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-09-03T11:46:07Z</dc:date>
    <item>
      <title>How to find the most matching result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-matching-result/m-p/257943#M77270</link>
      <description>&lt;P&gt;Dear all Splunkers&lt;/P&gt;

&lt;P&gt;I'm a newbie for splunk and quite frustrated any method can do somekind of compare/find the most matching result in search?&lt;/P&gt;

&lt;P&gt;Here are the situation, allow user input a value with XXXX-XXXX-XXXX-XXXX-XXXX  standard and match with below ID&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ID  
AAAA-BBBB-CCCC-DDDD 
AAAA-BBBB-CCCC  
AAAA-BBBB       
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;what i want find the most matching result&lt;/P&gt;

&lt;P&gt;for Example input AAAA-BBBB-XXXX-YYYY-ZZZZ&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ID  
AAAA-BBBB-CCCC-DDDD -&amp;gt; No match result
AAAA-BBBB-CCCC       -&amp;gt; No match result
AAAA-BBBB             -&amp;gt; Match with AAAA-BBBB --&amp;gt;&amp;gt; return some value
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Another Example input AAAA-BBBB-CCCC-YYYY-ZZZZ&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ID  
AAAA-BBBB-CCCC-DDDD     -&amp;gt; No match result
AAAA-BBBB-CCCC        -&amp;gt; Match with AAAA-BBBB-CCCC --&amp;gt;&amp;gt; return some value
AAAA-BBBB              -&amp;gt; No need to match with this 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tried to split the text first but no idea whats next.&lt;/P&gt;

&lt;P&gt;Should i use isnull or multisearch?? hope your can give me some hints on that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; cheers&lt;/P&gt;</description>
      <pubDate>Sat, 03 Sep 2016 03:33:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-matching-result/m-p/257943#M77270</guid>
      <dc:creator>CcCcCcCcCc1</dc:creator>
      <dc:date>2016-09-03T03:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the most matching result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-matching-result/m-p/257944#M77271</link>
      <description>&lt;P&gt;Here is a runanywhere sample that you can try. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval x=" AAAA-BBBB-CCCC-DDDD;AAAA-BBBB-CCCC;AAAA-BBBB" | makemv x delim=";" | mvexpand x | eval y="AAAA-BBBB-CCCC-YYYY-ZZZZ" | eval m=if(match(y, x."*"), "y", "n") | makemv x delim="-" | where m="y" | eventstats max(eval(mvcount(x))) as max  | where mvcount(x) = max
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Sep 2016 03:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-matching-result/m-p/257944#M77271</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-03T03:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the most matching result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-matching-result/m-p/257945#M77272</link>
      <description>&lt;P&gt;Use the regex command:&lt;/P&gt;

&lt;P&gt;... | regex aaaaa-bbbbb-ccccc&lt;/P&gt;

&lt;P&gt;Etc&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.4.3/SearchReference/Regex"&gt;https://docs.splunk.com/Documentation/Splunk/6.4.3/SearchReference/Regex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Sep 2016 11:46:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-matching-result/m-p/257945#M77272</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-09-03T11:46:07Z</dc:date>
    </item>
  </channel>
</rss>

