<?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: difference between NOT and != in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/difference-between-NOT-and/m-p/276526#M190354</link>
    <description>&lt;P&gt;"fieldname!=value" expect only matches events where the does field exist. NOT does not and matches also events where the field does not exist.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jul 2016 09:40:31 GMT</pubDate>
    <dc:creator>schose</dc:creator>
    <dc:date>2016-07-21T09:40:31Z</dc:date>
    <item>
      <title>difference between NOT and !=</title>
      <link>https://community.splunk.com/t5/Splunk-Search/difference-between-NOT-and/m-p/276523#M190351</link>
      <description>&lt;P&gt;Hi fellow Splunkers,&lt;/P&gt;

&lt;P&gt;I just fell over the difference between "NOT src_ip=1.2.3.4" and "src_ip!=1.2.3.4" in a basesearch. Can someone explain what the difference is and why?&lt;/P&gt;

&lt;P&gt;What I did was to use this statement in a basesearch, filtering out this single IP. What happens is:&lt;BR /&gt;
- "src_ip!=1.2.3.4": Filters out this single IP and all events with src_ip being null&lt;BR /&gt;
- "NOT src_ip=1.2.3.4": Filters out this single IP, leaves all events with null src_ip standing&lt;/P&gt;

&lt;P&gt;I know that "NOT src_ip=*" is the best way to search for empy or null occurences of src_ip. But I figure I should understand what is happening under the hood as well.&lt;/P&gt;

&lt;P&gt;Thanks for the enlightenment.&lt;/P&gt;

&lt;P&gt;Olli&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/difference-between-NOT-and/m-p/276523#M190351</guid>
      <dc:creator>Olli1919</dc:creator>
      <dc:date>2020-09-29T10:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: difference between NOT and !=</title>
      <link>https://community.splunk.com/t5/Splunk-Search/difference-between-NOT-and/m-p/276524#M190352</link>
      <description>&lt;P&gt;Thinking about it, I would assume that "src_ip!=" needs a fieldvalue to compare with. Probably a "check this fieldvalue, remove the match". So if no fieldvalue is there, the the clause cannot come back being positive, because it cannot be checked.&lt;/P&gt;

&lt;P&gt;Whereas "NOT src_ip" negates the clause. Which is negative when either this wanted value exists or when the field cannot be checked. So on both occurences it comes back negative, negated again gives a positive.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2016 08:17:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/difference-between-NOT-and/m-p/276524#M190352</guid>
      <dc:creator>Olli1919</dc:creator>
      <dc:date>2016-07-21T08:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: difference between NOT and !=</title>
      <link>https://community.splunk.com/t5/Splunk-Search/difference-between-NOT-and/m-p/276525#M190353</link>
      <description>&lt;P&gt;from the splunk search manual... &lt;/P&gt;

&lt;P&gt;Difference between NOT and !=&lt;BR /&gt;
When you want to exclude results from your search you can use the NOT&lt;BR /&gt;
operator or the != field expression. However there is a significant difference in the&lt;BR /&gt;
results that are returned from these two methods.&lt;/P&gt;

&lt;P&gt;Suppose you have the following fields:&lt;BR /&gt;
· fieldA&lt;BR /&gt;
· fieldB&lt;BR /&gt;
· fieldC&lt;BR /&gt;
Each of these fields has 3 values, for example fieldA has value1, value2, and&lt;BR /&gt;
value3.&lt;/P&gt;

&lt;P&gt;If you search for fieldB!=value3, the search returns only those values for&lt;BR /&gt;
fieldB that are not value3:&lt;BR /&gt;
· fieldB=value1, fieldB=value2&lt;BR /&gt;
If fieldB does not exist, nothing is returned.&lt;/P&gt;

&lt;P&gt;If you search for NOT fieldB=value3, the search returns everything except&lt;BR /&gt;
fieldB=value3:&lt;BR /&gt;
· fieldA=value1, fieldA=value2, fieldA=value3&lt;BR /&gt;
· fieldB=value1, fieldB=value2&lt;BR /&gt;
· fieldC=value1, fieldC=value2, fieldC=3&lt;/P&gt;

&lt;P&gt;If fieldB does not exist, NOT fieldB=value3 returns:&lt;BR /&gt;
· fieldA=value1, fieldA=value2, fieldA=value3&lt;BR /&gt;
· fieldC=value1, fieldC=value2, fieldC=3&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2016 08:55:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/difference-between-NOT-and/m-p/276525#M190353</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-07-21T08:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: difference between NOT and !=</title>
      <link>https://community.splunk.com/t5/Splunk-Search/difference-between-NOT-and/m-p/276526#M190354</link>
      <description>&lt;P&gt;"fieldname!=value" expect only matches events where the does field exist. NOT does not and matches also events where the field does not exist.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2016 09:40:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/difference-between-NOT-and/m-p/276526#M190354</guid>
      <dc:creator>schose</dc:creator>
      <dc:date>2016-07-21T09:40:31Z</dc:date>
    </item>
  </channel>
</rss>

