<?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 Splunk search using operator returning opposite results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-using-operator-returning-opposite-results/m-p/109036#M28444</link>
    <description>&lt;P&gt;When I use the windows app to search for a hardrive with less than a certain amount of space to set up alerts, I sometimes get results that are opposite of what I am expecting. &lt;BR /&gt; &lt;BR /&gt;
For example when I use this search:&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;source=WMI:FreeDiskSpace NOT localhost host="hostname" Name="C:" FreeMegabytes&amp;lt;"9216"&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;I will get matching events which have FreeMegabytes values greater than 9216&lt;BR /&gt;&lt;BR /&gt;
However when I use the greater than operator search returns 0 results. This seems to be an intermittent problem. &lt;/P&gt;</description>
    <pubDate>Mon, 14 Nov 2011 21:28:47 GMT</pubDate>
    <dc:creator>tympaniplayer</dc:creator>
    <dc:date>2011-11-14T21:28:47Z</dc:date>
    <item>
      <title>Splunk search using operator returning opposite results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-using-operator-returning-opposite-results/m-p/109036#M28444</link>
      <description>&lt;P&gt;When I use the windows app to search for a hardrive with less than a certain amount of space to set up alerts, I sometimes get results that are opposite of what I am expecting. &lt;BR /&gt; &lt;BR /&gt;
For example when I use this search:&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;source=WMI:FreeDiskSpace NOT localhost host="hostname" Name="C:" FreeMegabytes&amp;lt;"9216"&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;I will get matching events which have FreeMegabytes values greater than 9216&lt;BR /&gt;&lt;BR /&gt;
However when I use the greater than operator search returns 0 results. This seems to be an intermittent problem. &lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2011 21:28:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-using-operator-returning-opposite-results/m-p/109036#M28444</guid>
      <dc:creator>tympaniplayer</dc:creator>
      <dc:date>2011-11-14T21:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search using operator returning opposite results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-using-operator-returning-opposite-results/m-p/109037#M28445</link>
      <description>&lt;P&gt;You might want to change your search to the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="WMI:FreeDiskSpace" NOT host=localhost host="hostname" Name="C:" | where FreeMegabytes &amp;lt; 9216 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Nov 2011 22:22:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-using-operator-returning-opposite-results/m-p/109037#M28445</guid>
      <dc:creator>tgow</dc:creator>
      <dc:date>2011-11-14T22:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search using operator returning opposite results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-using-operator-returning-opposite-results/m-p/109038#M28446</link>
      <description>&lt;P&gt;Thank you so much, still learning about how to search in splunk!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2011 15:17:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-using-operator-returning-opposite-results/m-p/109038#M28446</guid>
      <dc:creator>tympaniplayer</dc:creator>
      <dc:date>2011-11-15T15:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search using operator returning opposite results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-using-operator-returning-opposite-results/m-p/109039#M28447</link>
      <description>&lt;P&gt;By quoting the value on the right, Splunk will interpret it as a string.  Remove the quotes and all will be well.  I would not recommend &lt;CODE&gt;| where&lt;/CODE&gt;, as this is a far more inefficient search.  &lt;/P&gt;

&lt;P&gt;In general, you want to be as specific as possible to the left of the first pipe.  The one exception to this, where you have to use &lt;CODE&gt;where&lt;/CODE&gt;, is when you are comparing two fields, e.g. if foo and bar are extracted or calculated fields:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| where foo &amp;gt; bar
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Nov 2011 15:48:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-using-operator-returning-opposite-results/m-p/109039#M28447</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2011-11-15T15:48:49Z</dc:date>
    </item>
  </channel>
</rss>

