<?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: NOT Statement based on lookup not working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/NOT-Statement-based-on-lookup-not-working/m-p/558080#M158508</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236018"&gt;@rogueakula1&lt;/a&gt;&amp;nbsp;Can you try this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex "string_to_search_for" 
    [ | inputlookup mylookup 
    | fields IP 
    | eval h="host"."!=".'IP' 
    | return 1000 $h]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your number of hosts inside lookup are &amp;gt; 1000 just increase the number next to return command accordingly.&lt;/P&gt;&lt;P&gt;Your output query behind would become as follows, just a note != is less efficient and it would be impact your search performance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex "string_to_search_for" host!=ip_val1 OR host!=ip_val2 OR host!=ip_val3...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;---&lt;/P&gt;&lt;P&gt;An upvote would be appreciated and Accept solution if it helps!&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jul 2021 03:01:37 GMT</pubDate>
    <dc:creator>venkatasri</dc:creator>
    <dc:date>2021-07-02T03:01:37Z</dc:date>
    <item>
      <title>NOT Statement based on lookup not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/NOT-Statement-based-on-lookup-not-working/m-p/558070#M158501</link>
      <description>&lt;P&gt;I am trying to remove logs based on a lookup. This is what I am using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=myindex "string_to_search_for" NOT&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[inputlookup mylookup&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; | rename IP as host&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; | field host]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The end result is to exclude any logs that have the "host" field in the event. My inputlookup returns the correct value but my NOT statement isnt doing anything.&lt;/P&gt;&lt;P&gt;I am very new to Splunk so I am sure that I am missing something pretty easy.&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 20:28:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/NOT-Statement-based-on-lookup-not-working/m-p/558070#M158501</guid>
      <dc:creator>rogueakula1</dc:creator>
      <dc:date>2021-07-01T20:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: NOT Statement based on lookup not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/NOT-Statement-based-on-lookup-not-working/m-p/558080#M158508</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236018"&gt;@rogueakula1&lt;/a&gt;&amp;nbsp;Can you try this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex "string_to_search_for" 
    [ | inputlookup mylookup 
    | fields IP 
    | eval h="host"."!=".'IP' 
    | return 1000 $h]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your number of hosts inside lookup are &amp;gt; 1000 just increase the number next to return command accordingly.&lt;/P&gt;&lt;P&gt;Your output query behind would become as follows, just a note != is less efficient and it would be impact your search performance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex "string_to_search_for" host!=ip_val1 OR host!=ip_val2 OR host!=ip_val3...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;---&lt;/P&gt;&lt;P&gt;An upvote would be appreciated and Accept solution if it helps!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 03:01:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/NOT-Statement-based-on-lookup-not-working/m-p/558080#M158508</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-07-02T03:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: NOT Statement based on lookup not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/NOT-Statement-based-on-lookup-not-working/m-p/558168#M158534</link>
      <description>&lt;P&gt;I managed to get the search working. I ended up using a rex field that extracted the IP address from my logs and then used the search NOT. Worked well. Thanks for the response!&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=myindex "string_to_search_for"&lt;/P&gt;&lt;P&gt;| rex field=_raw "from (?&amp;lt;IP&amp;gt;[0-9.-]+)"&lt;/P&gt;&lt;P&gt;| search NOT&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[inputlookup mylookup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; | field IP]&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 14:42:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/NOT-Statement-based-on-lookup-not-working/m-p/558168#M158534</guid>
      <dc:creator>rogueakula1</dc:creator>
      <dc:date>2021-07-02T14:42:47Z</dc:date>
    </item>
  </channel>
</rss>

