<?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 How to exclude a string in dashboard search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579215#M201842</link>
    <description>&lt;P&gt;Hi, Splunkers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I run a splunk search,&amp;nbsp; I use&amp;nbsp; NOT&amp;nbsp; string&amp;nbsp; to exclude result with this string.&lt;/P&gt;&lt;P&gt;if I have a dashboard, how to add text or dropdown input to select this&amp;nbsp; string to exclude it from dashboard return?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;BTW, this string might not be a value of any field, just a random string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;</description>
    <pubDate>Thu, 23 Dec 2021 23:10:37 GMT</pubDate>
    <dc:creator>wangkevin1029</dc:creator>
    <dc:date>2021-12-23T23:10:37Z</dc:date>
    <item>
      <title>How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579215#M201842</link>
      <description>&lt;P&gt;Hi, Splunkers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I run a splunk search,&amp;nbsp; I use&amp;nbsp; NOT&amp;nbsp; string&amp;nbsp; to exclude result with this string.&lt;/P&gt;&lt;P&gt;if I have a dashboard, how to add text or dropdown input to select this&amp;nbsp; string to exclude it from dashboard return?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;BTW, this string might not be a value of any field, just a random string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 23:10:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579215#M201842</guid>
      <dc:creator>wangkevin1029</dc:creator>
      <dc:date>2021-12-23T23:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579216#M201843</link>
      <description>&lt;P&gt;(Just FYI this is best asked in&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/bd-p/splunk-dashboards" target="_blank" rel="noopener"&gt;Dashboards &amp;amp; Visualizations&lt;/A&gt;.) I do this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;In Simple XML&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      &amp;lt;input type="text" token="free_text_tok" searchWhenChanged="true"&amp;gt;
        &amp;lt;label&amp;gt;Arbitrary string&amp;lt;/label&amp;gt;
        &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
      &amp;lt;/input&amp;gt;
​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, go to the UI editor, "Add Input" and select Text. &amp;nbsp;Give a token name such as "free_text_tok".&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In your penel search, use $free_text_tok$ in search string, e.g.,&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;original search $free_text_tok$​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are several things you want to consider, like security. &amp;nbsp;Do you want your user to inject truly arbitrary string that could be interpreted as something else like a filter, a macro, etc. &amp;nbsp;I usually do a quotation mark,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;original search "$free_text_tok$"&lt;/LI-CODE&gt;&lt;P&gt;But even this is not safe against SQL injection-style attacks/goof-ups.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 00:24:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579216#M201843</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-12-24T00:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579217#M201844</link>
      <description>&lt;P&gt;Yanliu,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your quick response.&lt;/P&gt;&lt;P&gt;but what I want is not add a basic input to search it.&lt;/P&gt;&lt;PRE&gt; &amp;lt;input type="text" token="free_text_tok" searchWhenChanged="true"&amp;gt;
        &amp;lt;label&amp;gt;Arbitrary string&amp;lt;/label&amp;gt;
        &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
      &amp;lt;/input&amp;gt;&lt;/PRE&gt;&lt;P&gt;which results in&amp;nbsp;using $free_text_tok$ to search in my query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but what I need is NOT&amp;nbsp;&amp;nbsp;$free_text_tok$ in my search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 00:36:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579217#M201844</guid>
      <dc:creator>wangkevin1029</dc:creator>
      <dc:date>2021-12-24T00:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579219#M201846</link>
      <description>&lt;P&gt;Yanliu,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your quick response.&lt;/P&gt;&lt;P&gt;but what I want is not add a basic input to search it.&lt;/P&gt;&lt;PRE&gt; &amp;lt;input type="text" token="free_text_tok" searchWhenChanged="true"&amp;gt;
        &amp;lt;label&amp;gt;Arbitrary string&amp;lt;/label&amp;gt;
        &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
      &amp;lt;/input&amp;gt;&lt;/PRE&gt;&lt;P&gt;which results in&amp;nbsp;using $free_text_tok$ to search in my query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but what I need is NOT&amp;nbsp;&amp;nbsp;$free_text_tok$ in my search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 01:42:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579219#M201846</guid>
      <dc:creator>wangkevin1029</dc:creator>
      <dc:date>2021-12-24T01:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579223#M201847</link>
      <description>&lt;P&gt;Why don't you use "NOT" in your search?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 06:44:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579223#M201847</guid>
      <dc:creator>rrovers</dc:creator>
      <dc:date>2021-12-24T06:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579239#M201851</link>
      <description>&lt;P class="lia-align-left"&gt;rrovers，&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;I need to input this string in an input box or select this&amp;nbsp; string from dropdown list in dashboard.&lt;/P&gt;&lt;P class="lia-align-left"&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 15:56:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579239#M201851</guid>
      <dc:creator>wangkevin1029</dc:creator>
      <dc:date>2021-12-24T15:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579240#M201852</link>
      <description>&lt;P&gt;Besides, I can't use&amp;nbsp; NOT&amp;nbsp; $tokenname$ in xml,&amp;nbsp; cause I may or may not use this EXCLUDE string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 15:58:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579240#M201852</guid>
      <dc:creator>wangkevin1029</dc:creator>
      <dc:date>2021-12-24T15:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579241#M201853</link>
      <description>&lt;P&gt;You should be able to modify the contents of the token to include "NOT".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;input type="text" token="free_text_tok" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Arbitrary string&amp;lt;/label&amp;gt;
  &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
  &amp;lt;change&amp;gt;
    &amp;lt;condition&amp;gt;
      &amp;lt;set token="not_free_text_tok"&amp;gt;NOT $free_text_tok|s$&amp;lt;/set&amp;gt;
    &amp;lt;/condition&amp;gt;
  &amp;lt;/change&amp;gt;
&amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And use &lt;FONT face="courier new,courier"&gt;$not_free_text_tok$&lt;/FONT&gt; in the query.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 21:55:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579241#M201853</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-12-24T21:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579242#M201854</link>
      <description>&lt;PRE&gt;&amp;lt;change&amp;gt;
    &amp;lt;condition&amp;gt;
      &amp;lt;set token=not_free_text_tok&amp;gt;NOT $free_text_tok|s$&amp;lt;/set&amp;gt;
    &amp;lt;condition&amp;gt;
  &amp;lt;/set&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;should &amp;lt;condition&amp;gt; &amp;lt;/set&amp;gt; be&amp;nbsp; &amp;lt;/condition&amp;gt; &amp;lt;/change&amp;gt;?&lt;/P&gt;&lt;P&gt;besides, there is unquoted attribute value for line&amp;nbsp; &amp;nbsp;&amp;lt;set token=not_free_text_tok&amp;gt;........&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 21:55:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579242#M201854</guid>
      <dc:creator>wangkevin1029</dc:creator>
      <dc:date>2021-12-24T21:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579243#M201855</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;but what I need is NOT&amp;nbsp;&amp;nbsp;$free_text_tok$ in my search.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Sorry for the bad slip. &amp;nbsp;The search should be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;base search _raw!="*$free_text_tok$*"&lt;/LI-CODE&gt;&lt;P&gt;My first answer missed two points. &amp;nbsp;In addition to "NOT", you also need wildcards unless the arbitrary string is expected to be surrounded by blanks like a word.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 20:11:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579243#M201855</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-12-24T20:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579245#M201857</link>
      <description>&lt;P&gt;I may or may not have this text or dropdown input to exclude this string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;that means If I don't have this Exclude string by&amp;nbsp;this text or dropdown input,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then &amp;nbsp;search _raw!=""&amp;nbsp; ???&amp;nbsp; I tried sth similar, but not&amp;nbsp; working.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 20:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579245#M201857</guid>
      <dc:creator>wangkevin1029</dc:creator>
      <dc:date>2021-12-24T20:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579249#M201858</link>
      <description>&lt;P&gt;Thanks for proofreading.&amp;nbsp; I've corrected my reply.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 21:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579249#M201858</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-12-24T21:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579251#M201859</link>
      <description>&lt;P&gt;Update: &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/64273"&gt;@rrovers&lt;/a&gt;'&amp;nbsp;solution is correct. &amp;nbsp;The below workarounds are workable but not as good.&lt;/P&gt;&lt;BLOCKQUOTE&gt;I may or may not have this text or dropdown input to exclude this string.&lt;/BLOCKQUOTE&gt;&lt;P&gt;One trick that I have used is to set an impossible default, e.g.,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;input type="text" token="free_text_tok" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;Arbitrary string&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;Super‐cali‐fragil‐istic‐expi‐ali‐docious&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This way, you can still plug the exclusion in the main search as illustrated above.&lt;/P&gt;&lt;P&gt;Another method is to sacrifice some performance and perform exclusion in a filter, like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where NOT if(len("$free_text_tok$")==0, false(), searchmatch("*$free_text_tok$*"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use this with null default so your default &amp;nbsp;screen won't look silly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;input type="text" token="free_text_tok" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;Arbitrary string&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Dec 2021 05:47:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579251#M201859</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-12-25T05:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579252#M201860</link>
      <description>&lt;P&gt;In fact,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/64273"&gt;@rrovers&lt;/a&gt;'s suggestion is correct. &amp;nbsp;Use this in search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;original search NOT _raw="*$free_text_tok$*"&lt;/LI-CODE&gt;&lt;P&gt;This works with blank default, and won't sacrifice performance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Dec 2021 05:36:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579252#M201860</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-12-25T05:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579253#M201861</link>
      <description>&lt;P&gt;doesn't work.&lt;/P&gt;&lt;P&gt;if I put NOT _raw="*$free_text_tok$*"&amp;nbsp; in my search, then &amp;nbsp;it&amp;nbsp; changes to NOT _raw="*"*" "tokenvalue"*"&amp;nbsp;&lt;/P&gt;&lt;P&gt;if I put NOT _raw="$free_text_tok$"&amp;nbsp; in my search, &amp;nbsp;then it&amp;nbsp; changes to &amp;nbsp;NOT _raw=""*" "tokenvalue""&amp;nbsp; in real search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 25 Dec 2021 08:21:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579253#M201861</guid>
      <dc:creator>wangkevin1029</dc:creator>
      <dc:date>2021-12-25T08:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a string in dashboard search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579254#M201862</link>
      <description>&lt;P&gt;You are correct in that NOT _raw="*$free_text_tok$*" will still exclude everything when token value is null. &amp;nbsp;Try the other workarounds illustrated in &lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579251/highlight/true#M201859" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579251/highlight/true#M201859&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I made a sample dashboard using the "| where" method.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1"&amp;gt;
  &amp;lt;label&amp;gt;input test 2&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="text" token="free_text_tok" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;arbitrary&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;event&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal
| where NOT if(len("$free_text_tok$")==0, false(), searchmatch("*$free_text_tok$*"))&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="list.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/event&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Test searches seem to satisfy your requirements.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;if I put NOT _raw="*$free_text_tok$*"&amp;nbsp; in my search, then &amp;nbsp;it&amp;nbsp; changes to NOT _raw="*"*" "tokenvalue"*"&amp;nbsp;&amp;nbsp;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This part seems strange. &amp;nbsp;I made a test dashboard specifically for this. &amp;nbsp;As said, it returns nothing when input string is null. &amp;nbsp;But when there is value, it doesn't split into the result you get.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1"&amp;gt;
  &amp;lt;label&amp;gt;input test&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="text" token="free_text_tok" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;arbitrary&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;event&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal NOT _raw="*$free_text_tok$*"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="list.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/event&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;When input string is "admin", the search expands into&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal NOT _raw="*admin*"&lt;/LI-CODE&gt;&lt;P&gt;which is desired. (However, when input is "", search becomes&amp;nbsp;index=_internal NOT _raw="**" which is undesirable.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Dec 2021 09:27:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-string-in-dashboard-search/m-p/579254#M201862</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-12-25T09:27:45Z</dc:date>
    </item>
  </channel>
</rss>

