<?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 use &amp;quot;where&amp;quot; and &amp;quot;not in&amp;quot; and &amp;quot;like&amp;quot; in one query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-where-quot-and-quot-not-in-quot-and-quot-like/m-p/333534#M99200</link>
    <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="docker" AppDomain=Eos Level=INFO Message="Eos request calculated" NOT (host='castle' OR  host='local')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is also possible.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NOT (host='*castle*' OR  host='*local*')
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 13 Sep 2017 09:41:56 GMT</pubDate>
    <dc:creator>HiroshiSatoh</dc:creator>
    <dc:date>2017-09-13T09:41:56Z</dc:date>
    <item>
      <title>How to use "where" and "not in" and "like" in one query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-where-quot-and-quot-not-in-quot-and-quot-like/m-p/333533#M99199</link>
      <description>&lt;P&gt;I have the following query :&lt;BR /&gt;sourcetype="docker" AppDomain=Eos Level=INFO Message="Eos request calculated" | eval Val_Request_Data_Fetch_RefData=Round((Eos_Request_Data_Fetch_MarketData/1000),1)&lt;/P&gt;
&lt;P&gt;Which have 3 host like perf, castle, local.&lt;/P&gt;
&lt;P&gt;I want to use the above query bust excluding host like castle and local&lt;/P&gt;
&lt;P&gt;sourcetype="docker" AppDomain=Eos Level=INFO Message="Eos request calculated" | eval Val_Request_Data_Fetch_RefData=Round((Eos_Request_Data_Fetch_MarketData/1000),1) | where host NOT like 'castle' AND 'local' ??&lt;BR /&gt;Will it work&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 14:38:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-where-quot-and-quot-not-in-quot-and-quot-like/m-p/333533#M99199</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2022-11-17T14:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "where" and "not in" and "like" in one query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-where-quot-and-quot-not-in-quot-and-quot-like/m-p/333534#M99200</link>
      <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="docker" AppDomain=Eos Level=INFO Message="Eos request calculated" NOT (host='castle' OR  host='local')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is also possible.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NOT (host='*castle*' OR  host='*local*')
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Sep 2017 09:41:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-where-quot-and-quot-not-in-quot-and-quot-like/m-p/333534#M99200</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2017-09-13T09:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "where" and "not in" and "like" in one query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-where-quot-and-quot-not-in-quot-and-quot-like/m-p/333535#M99201</link>
      <description>&lt;P&gt;to wildcard NOT, you can do like what @HiroshiSatoh mentioned and go with &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="docker" AppDomain=Eos Level=INFO Message="Eos request calculated" NOT (host=*castle* OR  host=*local* OR host=*perf*)| eval Val_Request_Data_Fetch_RefData=Round((Eos_Request_Data_Fetch_MarketData/1000),1)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which will remove the hosts that contain perf, castle, or local from the base search&lt;BR /&gt;
or if you need to remove it later on in the search, after doing evals/stats with it, perhaps, using where and like would be like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|where NOT like(host,"%perf%") AND NOT like(host,"%castle%") AND NOT like(host,"%local%")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Sep 2017 11:37:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-where-quot-and-quot-not-in-quot-and-quot-like/m-p/333535#M99201</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-09-13T11:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "where" and "not in" and "like" in one query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-where-quot-and-quot-not-in-quot-and-quot-like/m-p/621171#M215930</link>
      <description>&lt;P&gt;You can also use:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NOT (host IN (*castle*,*local*))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So full query will be something like this:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;sourcetype="docker" AppDomain=Eos Level=INFO Message="Eos request calculated" NOT (host IN (*castle*,*local*)) &lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Nov 2022 05:51:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-where-quot-and-quot-not-in-quot-and-quot-like/m-p/621171#M215930</guid>
      <dc:creator>abbasimani</dc:creator>
      <dc:date>2022-11-17T05:51:49Z</dc:date>
    </item>
  </channel>
</rss>

