<?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 generate a search for an exact word pattern? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203068#M58996</link>
    <description>&lt;P&gt;Thanks a lot! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2016 12:52:46 GMT</pubDate>
    <dc:creator>danielcmarcosjr</dc:creator>
    <dc:date>2016-11-04T12:52:46Z</dc:date>
    <item>
      <title>How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203048#M58976</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I want to search a word in Splunk in a certain field for example "foo" and will return the following:&lt;/P&gt;

&lt;P&gt;foo bar&lt;BR /&gt;
only foo bar&lt;BR /&gt;
only foo&lt;/P&gt;

&lt;P&gt;and will not return:&lt;/P&gt;

&lt;P&gt;foos&lt;BR /&gt;
xfoo&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 13:44:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203048#M58976</guid>
      <dc:creator>danielcmarcosjr</dc:creator>
      <dc:date>2016-11-02T13:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203049#M58977</link>
      <description>&lt;P&gt;Did you try &lt;CODE&gt;*foo*&lt;/CODE&gt;, as that shall return &lt;CODE&gt;foos&lt;/CODE&gt; and &lt;CODE&gt;xfoo&lt;/CODE&gt; in events.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Updating&lt;/STRONG&gt; as per comment, to search exactly "foo", try &lt;CODE&gt;(foo)&lt;/CODE&gt; as a search term including the round brackets&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 15:40:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203049#M58977</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-02T15:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203050#M58978</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thanks for your reply but it should not display that way.&lt;BR /&gt;
It should be:&lt;/P&gt;

&lt;P&gt;foo bar&lt;BR /&gt;
only foo bar&lt;BR /&gt;
only foo&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 15:45:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203050#M58978</guid>
      <dc:creator>danielcmarcosjr</dc:creator>
      <dc:date>2016-11-02T15:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203051#M58979</link>
      <description>&lt;P&gt;Give this a try (run anywhere search, replace everything before the where clause with  your search, also replace the field1 with your field name)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 | eval field1="foo bar#only foo bar#only foo#not foos#foox no#don't fool me" | table field1 | makemv field1 delim="#" | mvexpand field1 
| where match(field1,"(\s|^)foo(\s|$)")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2016 15:55:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203051#M58979</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-11-02T15:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203052#M58980</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Thank you for your reply however are there any syntax that I can use instead of hardcoding the "foo bar" ....&lt;BR /&gt;
because the value is from text box.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:06:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203052#M58980</guid>
      <dc:creator>danielcmarcosjr</dc:creator>
      <dc:date>2016-11-02T16:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203053#M58981</link>
      <description>&lt;P&gt;that should be easy, try &lt;CODE&gt;(foo)&lt;/CODE&gt; in search term so that it only searches whole word "foo", nothing more or less.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:08:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203053#M58981</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-02T16:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203054#M58982</link>
      <description>&lt;P&gt;The value of textbox should be assigned to a token, just replace the foo in match function with that token, like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search  | where match(field1,"(\s|^)$yourtextboxToken$(\s|$)")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:15:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203054#M58982</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-11-02T16:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203055#M58983</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I need to search in specific field.&lt;BR /&gt;
like this&lt;BR /&gt;
I believe it will return an error&lt;BR /&gt;
field1=(foo)&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:15:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203055#M58983</guid>
      <dc:creator>danielcmarcosjr</dc:creator>
      <dc:date>2016-11-02T16:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203056#M58984</link>
      <description>&lt;P&gt;Try regex to your rescue&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search to return field1
| regex field1=".*\sfoo\s.*"
| complete your search
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:29:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203056#M58984</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-02T16:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203057#M58985</link>
      <description>&lt;P&gt;hmm. but I believe it will not return result "only foo" because there are no spaces after foo.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:31:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203057#M58985</guid>
      <dc:creator>danielcmarcosjr</dc:creator>
      <dc:date>2016-11-02T16:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203058#M58986</link>
      <description>&lt;P&gt;thanks. but it will not return result if the foo is the last word.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203058#M58986</guid>
      <dc:creator>danielcmarcosjr</dc:creator>
      <dc:date>2016-11-02T16:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203059#M58987</link>
      <description>&lt;P&gt;Have you tested it? (I provided a runanywhere query with sample data).&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:48:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203059#M58987</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-11-02T16:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203060#M58988</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; wow...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search to return field1
 | regex field1="(.*(^|\s)foo(\s|\n).*)"
 | complete your search
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;see this &lt;A href="https://regex101.com/r/R9dSz5/1"&gt;please&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:51:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203060#M58988</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-02T16:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203061#M58989</link>
      <description>&lt;P&gt;ow yes. it works. What if I have many textboxtoken that are in OR logical operator?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:53:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203061#M58989</guid>
      <dc:creator>danielcmarcosjr</dc:creator>
      <dc:date>2016-11-02T16:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203062#M58990</link>
      <description>&lt;P&gt;@somesoni2 - isn't there an exact phrase syntax such as &lt;CODE&gt;"only foo"&lt;/CODE&gt;? you would expect it from a search engine...&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:54:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203062#M58990</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-11-02T16:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203063#M58991</link>
      <description>&lt;P&gt;Then you'll create match-expression for each of the token.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search  | where match(field1,"(\s|^)$yourtextboxToken1$(\s|$)") OR match(field1,"(\s|^)$yourtextboxToken2$(\s|$)") OR ....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203063#M58991</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-11-02T16:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203064#M58992</link>
      <description>&lt;P&gt;@Ddrillic, not sure I understood your question? &lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203064#M58992</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-11-02T16:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203065#M58993</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;What if it should be case insensitive?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 17:09:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203065#M58993</guid>
      <dc:creator>danielcmarcosjr</dc:creator>
      <dc:date>2016-11-02T17:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203066#M58994</link>
      <description>&lt;P&gt;Maybe, regex will help.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your base search | regex "(\s|^)foo(\s|$)" 
Or
Your base search | regex "\bfoo\b"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2016 17:14:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203066#M58994</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-11-02T17:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for an exact word pattern?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203067#M58995</link>
      <description>&lt;P&gt;Add a (?i) at the start of the regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search  | where match(field1,"(?i)(\s|^)$yourtextboxToken1$(\s|$)") OR match(field1,"(?i)(\s|^)$yourtextboxToken2$(\s|$)") OR ....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Nov 2016 17:18:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-an-exact-word-pattern/m-p/203067#M58995</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2016-11-02T17:18:54Z</dc:date>
    </item>
  </channel>
</rss>

