<?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 &amp;quot;NOT TERM&amp;quot; removes results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499685#M195034</link>
    <description>&lt;P&gt;When using NOT TERM, please keep in mind the following bug (see the answer for the workaround):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex NOT TERM(b=c)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will yield zero results if all the events contain “a_b=c” like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;foo a_b=c b=d bar
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem appears to exist only for normal searches using NOT on TERM where “b=c” exists in other places like “a_b=c”.  It does not appear when using tstats.  It seems to be a post-search filter.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Dec 2019 12:51:13 GMT</pubDate>
    <dc:creator>landen99</dc:creator>
    <dc:date>2019-12-02T12:51:13Z</dc:date>
    <item>
      <title>"NOT TERM" removes results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499685#M195034</link>
      <description>&lt;P&gt;When using NOT TERM, please keep in mind the following bug (see the answer for the workaround):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex NOT TERM(b=c)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will yield zero results if all the events contain “a_b=c” like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;foo a_b=c b=d bar
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem appears to exist only for normal searches using NOT on TERM where “b=c” exists in other places like “a_b=c”.  It does not appear when using tstats.  It seems to be a post-search filter.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 12:51:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499685#M195034</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2019-12-02T12:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: "NOT TERM" removes results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499686#M195035</link>
      <description>&lt;P&gt;The work-around appears to be to explicitly include “TERM(a_b=c)” like this:&lt;BR /&gt;
index=myindex TERM(a_b=c) NOT TERM(b=c)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:13:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499686#M195035</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2020-09-30T03:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: "NOT TERM" removes results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499687#M195036</link>
      <description>&lt;P&gt;Also be aware of this:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Search/NOTexpressions"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Search/NOTexpressions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 16:11:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499687#M195036</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-02T16:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: "NOT TERM" removes results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499688#M195037</link>
      <description>&lt;P&gt;That's not a bug I think, it's just "b=c" is not a term in the lexicon&lt;/P&gt;

&lt;P&gt;fake results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="foo a_b=c b=d bar" 
| collect
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;can find it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary NOT TERM(b=c)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;can't find it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary NOT TERM(*b=c)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;validate:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| walklex index=summary 
| table * 
| search term="*b=c*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;tested on 8.0.1&lt;/P&gt;

&lt;P&gt;("_" is a minor segmenter)&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Admin/Segmentersconf"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/Admin/Segmentersconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Search/UseCASEandTERMtomatchphrases"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/Search/UseCASEandTERMtomatchphrases&lt;/A&gt;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;TERM: Match whatever is inside the&lt;BR /&gt;
parentheses as a single term in the&lt;BR /&gt;
index, even if it contains characters&lt;BR /&gt;
that are usually recognized as minor&lt;BR /&gt;
segmenters, such as periods or&lt;BR /&gt;
underscores. &lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;The TERM directive is useful when you&lt;BR /&gt;
are searching for a term:&lt;/P&gt;

&lt;P&gt;That contains minor breakers&lt;BR /&gt;
&lt;STRONG&gt;Is bound by major breakers&lt;/STRONG&gt;, such as spaces or commas Does not contain&lt;BR /&gt;
major breakers&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;and your term isn't bound by major breakers, but a major (the space) and a minor one (the "_")&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 17:28:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499688#M195037</guid>
      <dc:creator>mhoogcarspel_sp</dc:creator>
      <dc:date>2019-12-02T17:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: "NOT TERM" removes results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499689#M195038</link>
      <description>&lt;P&gt;Don't think this is accurate, have a look at my answer below&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 09:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499689#M195038</guid>
      <dc:creator>mhoogcarspel_sp</dc:creator>
      <dc:date>2019-12-03T09:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: "NOT TERM" removes results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499690#M195039</link>
      <description>&lt;P&gt;It is accurate.  Martin Mueller has verified it too.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 03:08:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-NOT-TERM-quot-removes-results/m-p/499690#M195039</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2019-12-07T03:08:47Z</dc:date>
    </item>
  </channel>
</rss>

