<?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 get subsearch to return a result which is NOT EQUAL to the returned value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205722#M59817</link>
    <description>&lt;P&gt;The opposite of &lt;CODE&gt;(id=10000) OR (id=10001) OR (id=10002)&lt;/CODE&gt; is &lt;CODE&gt;(id!=10000 AND id!=10001 AND id!=10002)&lt;/CODE&gt; or simply &lt;CODE&gt;NOT ((id=10000) OR (id=10001) OR (id=10002))&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;With subsearches fetching this filter condition it can be used either of following ways:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search query | search NOT [subsearch query | return field] | ....

 search query NOT [subsearch query | return field] ....

 search query | where NOT [subsearch query | return field]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Dec 2016 15:56:03 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-12-23T15:56:03Z</dc:date>
    <item>
      <title>How to get subsearch to return a result which is NOT EQUAL to the returned value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205720#M59815</link>
      <description>&lt;P&gt;Hi there, currently I am comparing data from two data sources and have achieved some great comparisons in which my subsearch returned field value equaling the matching value eg:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(id=10000) or (id=10001) or (id=10002)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;etc..&lt;/P&gt;

&lt;P&gt;However I am wondering if it is possible to return something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(id!=10000) or (id!=10001) or (id!=10002)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;etc..&lt;/P&gt;

&lt;P&gt;OR alternatively - can I simply do something like this in my search query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search query | NOT [subsearch query | return field]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or perhaps with brackets?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search query | (NOT [subsearch query | return field])
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please help!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 00:55:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205720#M59815</guid>
      <dc:creator>alexandermunce</dc:creator>
      <dc:date>2016-12-23T00:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get subsearch to return a result which is NOT EQUAL to the returned value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205721#M59816</link>
      <description>&lt;P&gt;I would follow the kiss principle and use - &lt;CODE&gt;search query NOT id=10000 NOT id=10001 NOT id=10002&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;BTW - please use &lt;STRONG&gt;OR&lt;/STRONG&gt; (versus or) such as - &lt;CODE&gt;(id=10000) OR (id=10001) OR (id=10002)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 03:57:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205721#M59816</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-12-23T03:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to get subsearch to return a result which is NOT EQUAL to the returned value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205722#M59817</link>
      <description>&lt;P&gt;The opposite of &lt;CODE&gt;(id=10000) OR (id=10001) OR (id=10002)&lt;/CODE&gt; is &lt;CODE&gt;(id!=10000 AND id!=10001 AND id!=10002)&lt;/CODE&gt; or simply &lt;CODE&gt;NOT ((id=10000) OR (id=10001) OR (id=10002))&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;With subsearches fetching this filter condition it can be used either of following ways:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search query | search NOT [subsearch query | return field] | ....

 search query NOT [subsearch query | return field] ....

 search query | where NOT [subsearch query | return field]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Dec 2016 15:56:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205722#M59817</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-12-23T15:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get subsearch to return a result which is NOT EQUAL to the returned value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205723#M59818</link>
      <description>&lt;P&gt;The output you have provided is simply the output of ,y above subquery? Not what I was after sorry&lt;/P&gt;</description>
      <pubDate>Sun, 25 Dec 2016 13:38:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205723#M59818</guid>
      <dc:creator>alexandermunce</dc:creator>
      <dc:date>2016-12-25T13:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get subsearch to return a result which is NOT EQUAL to the returned value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205724#M59819</link>
      <description>&lt;P&gt;Exactly what I was after, thank you good sir!&lt;/P&gt;</description>
      <pubDate>Sun, 25 Dec 2016 13:38:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205724#M59819</guid>
      <dc:creator>alexandermunce</dc:creator>
      <dc:date>2016-12-25T13:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get subsearch to return a result which is NOT EQUAL to the returned value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205725#M59820</link>
      <description>&lt;P&gt;@somesoni2&lt;/P&gt;

&lt;P&gt;Based on your response above - would I need to place brackets around the subsearch similar to below;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search query NOT ([subsearch query | return field])
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Dec 2016 01:49:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205725#M59820</guid>
      <dc:creator>alexandermunce</dc:creator>
      <dc:date>2016-12-28T01:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get subsearch to return a result which is NOT EQUAL to the returned value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205726#M59821</link>
      <description>&lt;P&gt;@somesoni2&lt;/P&gt;

&lt;P&gt;I am concerned that my search will end up as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search query NOT (id=10000) OR (id=10001) OR (id=10002)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This above syntax is not valid right?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2016 01:51:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205726#M59821</guid>
      <dc:creator>alexandermunce</dc:creator>
      <dc:date>2016-12-28T01:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get subsearch to return a result which is NOT EQUAL to the returned value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205727#M59822</link>
      <description>&lt;P&gt;Above one is not valid/correct for your requirements. The subsearch will automatically put proper brackets when resolved. You can validate that by checking the job Inspector, look for attribute normalized search.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2016 02:01:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/205727#M59822</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-12-28T02:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get subsearch to return a result which is NOT EQUAL to the returned value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/571977#M199313</link>
      <description>&lt;P&gt;Please note that id!=1 and NOT id=1 are NOT equal.&lt;/P&gt;&lt;P&gt;If you have the following events&lt;/P&gt;&lt;P&gt;id=1 someotherfield=a&lt;BR /&gt;someotherfield=a&lt;BR /&gt;id=1 someotherfield=a&lt;BR /&gt;id=2 someotherfield=b&lt;/P&gt;&lt;P&gt;searching for someotherfield=a NOT id=1 leads to&lt;/P&gt;&lt;P&gt;someotherfield=a&lt;BR /&gt;id=2 someotherfield=b&lt;/P&gt;&lt;P&gt;whereas searching for someotherfield=a id!=1 leads to&lt;/P&gt;&lt;P&gt;id=2 someotherfield=b&lt;/P&gt;&lt;P&gt;as id!=1 only returns events that contain field id, but not value 1, whereas NOT id=1 removes events with id=1 from the previous event set.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 09:49:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-subsearch-to-return-a-result-which-is-NOT-EQUAL-to/m-p/571977#M199313</guid>
      <dc:creator>dvb</dc:creator>
      <dc:date>2021-10-22T09:49:47Z</dc:date>
    </item>
  </channel>
</rss>

