<?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: What is the most efficent way to do partial matches on a field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388687#M113334</link>
    <description>&lt;P&gt;@uhaq The question is what is the most efficient way to do a partial match on a field. E.g. is field=&amp;amp;ast;somevalue&amp;amp;ast; more efficient than regex field=somevalue.&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2019 16:40:09 GMT</pubDate>
    <dc:creator>frbuser</dc:creator>
    <dc:date>2019-05-28T16:40:09Z</dc:date>
    <item>
      <title>What is the most efficent way to do partial matches on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388682#M113329</link>
      <description>&lt;P&gt;I want to check if a field contains a specific value and the field is multivalue.&lt;/P&gt;

&lt;P&gt;What is the most efficient way to check this? I understand that using wildcards is only efficient when matching at the end of a string. So a match like field=&amp;amp;ast;somevalue&amp;amp;ast; is very inefficient. Would using the regex command be more efficient or would mvfind be better?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt;&lt;BR /&gt;
As an example lets say I am searching proxy logs which contain a host field and a category field. Host field will only contain one value where category is a multivalue field.&lt;/P&gt;

&lt;P&gt;If I want to match all records which contain a specific category "email" but doesn't contain the following string in the host field ".domain.com" where the beginning of the domain is variable, what is the most efficient way?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 14:49:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388682#M113329</guid>
      <dc:creator>frbuser</dc:creator>
      <dc:date>2019-05-28T14:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficent way to do partial matches on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388683#M113330</link>
      <description>&lt;P&gt;Hi frbuser,&lt;BR /&gt;
As you said, regex command is the most efficient that you can use but it depends on the string to search.&lt;BR /&gt;
You only have to create a correct regex, if you share some example and the results you like, I could help you more.&lt;/P&gt;

&lt;P&gt;bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:25:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388683#M113330</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-05-28T15:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficent way to do partial matches on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388684#M113331</link>
      <description>&lt;P&gt;@gcusello My questions is more of a general one. The scenario is anytime you want to match a value that is a substring of a field. So the value you are matching may appear anywhere in the field. It could be at the beginning, middle, or end, or it may be the entire field itself. &lt;/P&gt;

&lt;P&gt;Also, the field may be a multivalue field, and the value you are trying to match may be a substring of any of the values.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:29:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388684#M113331</guid>
      <dc:creator>frbuser</dc:creator>
      <dc:date>2019-05-28T15:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficent way to do partial matches on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388685#M113332</link>
      <description>&lt;P&gt;If the question is about how to make the search efficient, follow best practices on adding filters as early as possible (e.g define your index,st,source etc). Using fields and then stats to reduce the amount of unnecessary fields also helps.&lt;/P&gt;

&lt;P&gt;If you know that the value of your FQDN host will be &lt;EM&gt;hostname&lt;/EM&gt;.domain.com you can try incorporating NOT TERM(&lt;EM&gt;hostname&lt;/EM&gt;.domain.com) in your search as well. This does not always increase your search efficiency and really depends on the scenario. &lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:45:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388685#M113332</guid>
      <dc:creator>uhaq</dc:creator>
      <dc:date>2019-05-28T15:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficent way to do partial matches on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388686#M113333</link>
      <description>&lt;P&gt;Hi @frbuser,&lt;/P&gt;

&lt;P&gt;Generally speaking, if what you're looking for is a part of a field that could be anywhere (begining, middle,end) then what you suggested is the only solution.&lt;/P&gt;

&lt;P&gt;More specifically, in some case you can optimize by replacing the &lt;CODE&gt;*&lt;/CODE&gt; at the begining or end by a regexp if you already have an idea of what that is but that is considering you already know what the possible values would be.&lt;/P&gt;

&lt;P&gt;Finally and to talk about &lt;CODE&gt;mvfind&lt;/CODE&gt; this applies to multi values field and will behave the same way as would writing a regex would.&lt;/P&gt;

&lt;P&gt;So I would say to optimize a partial match you would need to know what are the possibilities for the unknown part to be able to improve it. If it's all unknown then that's a &lt;CODE&gt;*&lt;/CODE&gt; for you &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 16:17:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388686#M113333</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-28T16:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficent way to do partial matches on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388687#M113334</link>
      <description>&lt;P&gt;@uhaq The question is what is the most efficient way to do a partial match on a field. E.g. is field=&amp;amp;ast;somevalue&amp;amp;ast; more efficient than regex field=somevalue.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 16:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/388687#M113334</guid>
      <dc:creator>frbuser</dc:creator>
      <dc:date>2019-05-28T16:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficent way to do partial matches on a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/519059#M146149</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/159954" target="_self"&gt;frbuser&lt;/A&gt;&amp;nbsp;,&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/104482" target="_self"&gt;uhaq,&lt;/A&gt;&lt;SPAN class="login-bold"&gt;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352" target="_self"&gt;gcusello&lt;/A&gt;,&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/68181" target="_self"&gt;DavidHourani&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Where you able to get a optimized approach?,Im also searching for a solution to optimize rather than search with&amp;nbsp; * .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;eg ..category=Blogs,Software/Technology,Malware,Block List,Computer Security&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;i want to search if only &lt;STRONG&gt;malware&lt;/STRONG&gt; is available as a substring&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Im using this SPL --&amp;gt;index=abc category="*malware*"| stats count by category&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Can i make it more optimized?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks in Advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Jbz&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 13:14:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficent-way-to-do-partial-matches-on-a-field/m-p/519059#M146149</guid>
      <dc:creator>jabezds</dc:creator>
      <dc:date>2020-09-11T13:14:48Z</dc:date>
    </item>
  </channel>
</rss>

