<?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 do you exclude an item from a lookup table and an additional condition? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-an-item-from-a-lookup-table-and-an-additional/m-p/418234#M120281</link>
    <description>&lt;P&gt;Thanks for the response. I'm actually trying to exclude events where the device_id is in my lookup table.  So doing  &lt;CODE&gt;| search ignore="*"&lt;/CODE&gt; retrieves events that I want to exclude. Because &lt;CODE&gt;"ignore"&lt;/CODE&gt; isn't a field on the other events, I can't do &lt;CODE&gt;ignore !="*"&lt;/CODE&gt;. I was using &lt;CODE&gt;isnull(ignore)&lt;/CODE&gt; because that returns events where there is no &lt;CODE&gt;ignore&lt;/CODE&gt; field.  &lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2019 13:37:44 GMT</pubDate>
    <dc:creator>yemyslf</dc:creator>
    <dc:date>2019-03-01T13:37:44Z</dc:date>
    <item>
      <title>How do you exclude an item from a lookup table and an additional condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-an-item-from-a-lookup-table-and-an-additional/m-p/418232#M120279</link>
      <description>&lt;P&gt;I have a lookup table that I'm using to exclude some devices from search results. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = my_index  
    | lookup my_table local=true device_id OUTPUT device_id as ignore  
    | where isnull(ignore)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works great, but I need to add an additional condition to only exclude devices if they are in the lookup table and the value of the field "code" = 0001. So an event shouldn't be excluded even if it is in the lookup table unless &lt;CODE&gt;code=0001&lt;/CODE&gt; and events with &lt;CODE&gt;code=0001&lt;/CODE&gt; should be included if they are not in the lookup table.&lt;/P&gt;

&lt;P&gt;I've tried the following but this also removes all items where&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; code=0001
index = my_index  
    | lookup my_table local=true device_id OUTPUT device_id as ignore  
    | where (isnull(ignore) AND code!=0001)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I assume this is a dumb mistake in my logic but can't figure out what I'm doing wrong?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 22:32:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-an-item-from-a-lookup-table-and-an-additional/m-p/418232#M120279</guid>
      <dc:creator>yemyslf</dc:creator>
      <dc:date>2019-02-28T22:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do you exclude an item from a lookup table and an additional condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-an-item-from-a-lookup-table-and-an-additional/m-p/418233#M120280</link>
      <description>&lt;P&gt;If you are looking to filter out events where ignore is null you can actually do this as well:  &lt;CODE&gt;ignore="*"&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;This essentially means ignore needs to have a value.&lt;/P&gt;

&lt;P&gt;Also, to do the second filter I would do it this way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index 
| lookup my_table local=true device_id OUTPUT device_id as ignore 
| search ignore="*" code!=0001
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the last line, anything after the  &lt;CODE&gt;search&lt;/CODE&gt; command implies  &lt;CODE&gt;AND&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 01:14:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-an-item-from-a-lookup-table-and-an-additional/m-p/418233#M120280</guid>
      <dc:creator>integratorz</dc:creator>
      <dc:date>2019-03-01T01:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do you exclude an item from a lookup table and an additional condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-an-item-from-a-lookup-table-and-an-additional/m-p/418234#M120281</link>
      <description>&lt;P&gt;Thanks for the response. I'm actually trying to exclude events where the device_id is in my lookup table.  So doing  &lt;CODE&gt;| search ignore="*"&lt;/CODE&gt; retrieves events that I want to exclude. Because &lt;CODE&gt;"ignore"&lt;/CODE&gt; isn't a field on the other events, I can't do &lt;CODE&gt;ignore !="*"&lt;/CODE&gt;. I was using &lt;CODE&gt;isnull(ignore)&lt;/CODE&gt; because that returns events where there is no &lt;CODE&gt;ignore&lt;/CODE&gt; field.  &lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 13:37:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-exclude-an-item-from-a-lookup-table-and-an-additional/m-p/418234#M120281</guid>
      <dc:creator>yemyslf</dc:creator>
      <dc:date>2019-03-01T13:37:44Z</dc:date>
    </item>
  </channel>
</rss>

