<?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 filter list of hosts from 2 lookup tables? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318921#M95372</link>
    <description>&lt;P&gt;@pavanae - if the answer has solved your issue, please accept the answer so the question will show as closed. &lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2017 02:57:34 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-10-23T02:57:34Z</dc:date>
    <item>
      <title>How to filter list of hosts from 2 lookup tables?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318918#M95369</link>
      <description>&lt;P&gt;I have a lookup search  as follows &lt;/P&gt;

&lt;P&gt;|inputlookup hostnames.csv &lt;/P&gt;

&lt;P&gt;Which displays the results as follows &lt;/P&gt;

&lt;P&gt;my_hostname&lt;/P&gt;

&lt;P&gt;abc.com&lt;BR /&gt;
fgb.com&lt;/P&gt;

&lt;P&gt;Now I have another lookup as follows &lt;/P&gt;

&lt;P&gt;| inputlookup total_hosts.csv | rename Hostname as my_hostname | table my_hostname&lt;/P&gt;

&lt;P&gt;Which displays the results as follows&lt;/P&gt;

&lt;P&gt;my_hostname&lt;/P&gt;

&lt;P&gt;xyz.abc.com&lt;BR /&gt;
abc.com&lt;BR /&gt;
fgb.com&lt;BR /&gt;
yhk&lt;BR /&gt;
kjhgd.com&lt;/P&gt;

&lt;P&gt;Now how can I filter the list of hosts that were in total_hosts.csv and not in the hostnames.csv. I'm just trying to see the list of hosts that were missing in hostnames.csv by comparing with hosts on total_hosts.csv&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:21:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318918#M95369</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2020-09-29T16:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter list of hosts from 2 lookup tables?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318919#M95370</link>
      <description>&lt;P&gt;Here's how I would do that:&lt;BR /&gt;
&lt;CODE&gt;| inputlookup total_hosts.csv | lookup hostnames.csv my_hostname OUTPUT my_hostname AS found_hostname | where isnull(found_hostname)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Or if you are certain that all all the hostnames in hostnames.csv are in total_hosts.csv (so total_hosts.csv list is a strict superset of hostnames.csv), then I believe  this should work:&lt;BR /&gt;
&lt;CODE&gt;| set diff [ | inputlookup total_hosts.csv ]  [| inputlookup hostnames.csv]&lt;/CODE&gt;&lt;BR /&gt;
But be forewarned that if there are any entries in hostnames.csv that weren't in total_hosts.csv, then they will also show up in this result set.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:17:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318919#M95370</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2020-09-29T16:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter list of hosts from 2 lookup tables?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318920#M95371</link>
      <description>&lt;P&gt;One more option I just thought of: &lt;BR /&gt;
&lt;CODE&gt;| inputlookup total_hosts.csv | search NOT [ | inputlookup hostnames.csv | format ]&lt;/CODE&gt;&lt;BR /&gt;
I think that's the proper syntax.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 19:27:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318920#M95371</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-10-19T19:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter list of hosts from 2 lookup tables?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318921#M95372</link>
      <description>&lt;P&gt;@pavanae - if the answer has solved your issue, please accept the answer so the question will show as closed. &lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 02:57:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318921#M95372</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-23T02:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter list of hosts from 2 lookup tables?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318922#M95373</link>
      <description>&lt;P&gt;@elliotproebstel - Your first answer is the best technically, in my opinion.  NOTs are inefficient, and &lt;CODE&gt;set diff&lt;/CODE&gt;, as you noted, doesn't give any indication of which set the extra record may have been in.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 02:59:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318922#M95373</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-23T02:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter list of hosts from 2 lookup tables?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318923#M95374</link>
      <description>&lt;P&gt;Thanks for the feedback. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Getting this kind of guidance is the best perk of participating in Splunk Answers.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 18:35:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-list-of-hosts-from-2-lookup-tables/m-p/318923#M95374</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-10-23T18:35:57Z</dc:date>
    </item>
  </channel>
</rss>

