<?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 do I make wildcard search work for begins with or ends with searches? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14384#M1521</link>
    <description>&lt;P&gt;Please add your clarifications to your original post (use the "edit" link) instead of adding a new "answer" like this.&lt;/P&gt;</description>
    <pubDate>Fri, 28 May 2010 22:58:28 GMT</pubDate>
    <dc:creator>Lowell</dc:creator>
    <dc:date>2010-05-28T22:58:28Z</dc:date>
    <item>
      <title>How do I make wildcard search work for begins with or ends with searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14380#M1517</link>
      <description>&lt;P&gt;I have a defined field that I'm trying to perform searches against with wild cards, so given the texts:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;text2search blah blah&lt;/LI&gt;
&lt;LI&gt;blah text2search blah&lt;/LI&gt;
&lt;LI&gt;blah blah text2search&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;And the following searches should return the specified item:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;my_field="*text2search"&lt;/CODE&gt;   --&amp;gt; #3&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;my_field="*text2search*"&lt;/CODE&gt;  --&amp;gt; #1, 2, 3&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;my_field="text2search*"&lt;/CODE&gt;   --&amp;gt; #1&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;But A and C actually return nothing.  How would I get this to work like I expect it?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2010 12:44:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14380#M1517</guid>
      <dc:creator>alfredhong</dc:creator>
      <dc:date>2010-05-27T12:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make wildcard search work for begins with or ends with searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14381#M1518</link>
      <description>&lt;P&gt;How is the field &lt;CODE&gt;my_field&lt;/CODE&gt; actually extracted? Are there actually spaces delimiting both sides of &lt;CODE&gt;text2search&lt;/CODE&gt; (and &lt;CODE&gt;blah&lt;/CODE&gt;) in all cases? Is &lt;CODE&gt;text2search&lt;/CODE&gt; actually just a word without internal spaces or punctuation? Does the search work if you &lt;EM&gt;don't&lt;/EM&gt; specify &lt;CODE&gt;my_field&lt;/CODE&gt; but just search for &lt;CODE&gt;text2search&lt;/CODE&gt; (or &lt;CODE&gt;*text2search&lt;/CODE&gt; or whatever)? Are you running these searches from the Splunk GUI?&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2010 18:06:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14381#M1518</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-05-27T18:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make wildcard search work for begins with or ends with searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14382#M1519</link>
      <description>&lt;P&gt;gkanapathy raises good questions.  If the below search works for &lt;EM&gt;case A&lt;/EM&gt; then perhaps the field extraction may need to be tweaked to remove leading/trailing spaces or tabs.   &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my_field="*text2search*" | eval my_field=trim(my_field) | search my_field="*text2search"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 May 2010 20:21:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14382#M1519</guid>
      <dc:creator>bwooden</dc:creator>
      <dc:date>2010-05-27T20:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make wildcard search work for begins with or ends with searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14383#M1520</link>
      <description>&lt;P&gt;Great questions.  Let me clarify them:&lt;/P&gt;

&lt;P&gt;How is the field my_field actually extracted? &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;It is extracted via a regex in transforms.conf, and it can be "a sentence like this". Segmentation is set to inner for the source.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Are there actually spaces delimiting both sides of text2search (and blah) in all cases? &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;Not in terms of my example; I meant for "text2search" to mean exactly a word.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Is text2search actually just a word without internal spaces or punctuation? &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;Yes.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Does the search work if you don't  specify my_field but just search for text2search  (or *text2search or whatever)? &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;Not exactly.  It seems for a past 24 hour search I get the same result for *text2search, &lt;EM&gt;text2search&lt;/EM&gt;, text2search*, text2search.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Are you running these searches from the Splunk GUI?&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;Yes, tried that to verify against programmatic searches, which have the same results&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 27 May 2010 23:19:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14383#M1520</guid>
      <dc:creator>alfredhong</dc:creator>
      <dc:date>2010-05-27T23:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make wildcard search work for begins with or ends with searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14384#M1521</link>
      <description>&lt;P&gt;Please add your clarifications to your original post (use the "edit" link) instead of adding a new "answer" like this.&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2010 22:58:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14384#M1521</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-05-28T22:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make wildcard search work for begins with or ends with searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14385#M1522</link>
      <description>&lt;P&gt;This should normally work, and its failure probably has something to do with the heuristic of looking for the value in the index. The first check to make is to not put the field comparison in the initial part of the search. Does a search for just &lt;CODE&gt;*text2search&lt;/CODE&gt; yield all the results that should match your field search. Another way is instead of:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my_field="*text2search"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | search my_field="*text2search"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Aug 2010 01:39:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14385#M1522</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-08-20T01:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make wildcard search work for begins with or ends with searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14386#M1523</link>
      <description>&lt;P&gt;To backup the answer from Stephen Sorkin, I've had a similar problem with searches using wildcards, and found it was resolved through putting the wildcard query after  | search &lt;/P&gt;

&lt;P&gt;The link between my situation and that of the original poster I think is segmentation startegy.  I've come across this problem when experimenting with using outer segmentation.  Are issues with wildcard searches in this way related to disabling full segmentation?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2011 17:33:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-make-wildcard-search-work-for-begins-with-or-ends-with/m-p/14386#M1523</guid>
      <dc:creator>sumnerm</dc:creator>
      <dc:date>2011-01-18T17:33:07Z</dc:date>
    </item>
  </channel>
</rss>

