<?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 exclude results from a search by referencing a lookup table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-results-from-a-search-by-referencing-a-lookup/m-p/517282#M145443</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225682"&gt;@ezmo1982&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;This should do it. I had to rename user, because I needed it to have another name as the one in the lookup and i had to replace the dot in location.city and location.country with a "_", because my &lt;EM&gt;where&amp;nbsp;&lt;/EM&gt;did not work correct when the fields had the dot (don't know why...)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval user="John", location.country="France", location.city="Paris"
| rename user AS search_user, location.country AS location_country, location.city AS location_city
| appendcols [| inputlookup locations.csv]
| where NOT (location_country==country AND user==search_user AND location_city==city)
| fields user, location_country, location_city&lt;/LI-CODE&gt;&lt;P&gt;You used need the lines starting with the &lt;EM&gt;rename&lt;/EM&gt; command, the 2 above them where just to make up an event with a sample dataset.&lt;BR /&gt;&lt;BR /&gt;Hope it works with your data.&lt;BR /&gt;&lt;BR /&gt;BR&lt;BR /&gt;Ralph&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Sep 2020 15:30:48 GMT</pubDate>
    <dc:creator>rnowitzki</dc:creator>
    <dc:date>2020-09-01T15:30:48Z</dc:date>
    <item>
      <title>How to exclude results from a search by referencing a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-results-from-a-search-by-referencing-a-lookup/m-p/517262#M145436</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a search that is returning values from certain fields of an index. I would like the search to use a lookup table and check if the values exist in the lookup table. If they do, I need them to be excluded from the search results.&lt;/P&gt;&lt;P&gt;My search term is below and returns 3 fields of the index in question:&lt;/P&gt;&lt;P&gt;index=duo&lt;BR /&gt;| fields user location.country location.city | table user location.country location.city&lt;/P&gt;&lt;P&gt;My lookup table is named locations.csv, which has 3 columns - user, country, city&amp;nbsp; So as an example, values for one row could be &lt;STRONG&gt;John&lt;/STRONG&gt; &lt;STRONG&gt;France&lt;/STRONG&gt; &lt;STRONG&gt;Paris&lt;/STRONG&gt; . If the search returns a result where&lt;STRONG&gt; user=John, location.country=France and location.city=Paris&lt;/STRONG&gt;, I want that to be excluded from the search results as it exists in the lookup file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is important that all 3 values must exist on a row in the lookup file csv, for it to be excluded in the search results.&lt;/P&gt;&lt;P&gt;Can someone please help me on this?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 15:00:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-results-from-a-search-by-referencing-a-lookup/m-p/517262#M145436</guid>
      <dc:creator>ezmo1982</dc:creator>
      <dc:date>2020-09-01T15:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude results from a search by referencing a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-results-from-a-search-by-referencing-a-lookup/m-p/517268#M145438</link>
      <description>&lt;P&gt;Try a subsearch.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=duo NOT [ | inputlookup locations.csv | rename country as 'location.country', city as 'location.city' | fields user 'location.country' 'location.city' | format ]
| fields user location.country location.city | table user location.country location.city&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Sep 2020 15:19:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-results-from-a-search-by-referencing-a-lookup/m-p/517268#M145438</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-01T15:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude results from a search by referencing a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-results-from-a-search-by-referencing-a-lookup/m-p/517282#M145443</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225682"&gt;@ezmo1982&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;This should do it. I had to rename user, because I needed it to have another name as the one in the lookup and i had to replace the dot in location.city and location.country with a "_", because my &lt;EM&gt;where&amp;nbsp;&lt;/EM&gt;did not work correct when the fields had the dot (don't know why...)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval user="John", location.country="France", location.city="Paris"
| rename user AS search_user, location.country AS location_country, location.city AS location_city
| appendcols [| inputlookup locations.csv]
| where NOT (location_country==country AND user==search_user AND location_city==city)
| fields user, location_country, location_city&lt;/LI-CODE&gt;&lt;P&gt;You used need the lines starting with the &lt;EM&gt;rename&lt;/EM&gt; command, the 2 above them where just to make up an event with a sample dataset.&lt;BR /&gt;&lt;BR /&gt;Hope it works with your data.&lt;BR /&gt;&lt;BR /&gt;BR&lt;BR /&gt;Ralph&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 15:30:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-results-from-a-search-by-referencing-a-lookup/m-p/517282#M145443</guid>
      <dc:creator>rnowitzki</dc:creator>
      <dc:date>2020-09-01T15:30:48Z</dc:date>
    </item>
  </channel>
</rss>

