<?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 results using fields from lookup file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-results-using-fields-from-lookup-file/m-p/381119#M111498</link>
    <description>&lt;P&gt;How's this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=foo sourcetype=bar NOT [|inputlookup foobar |table ip,dnsName]
| dedup ip dnsName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Jul 2019 04:28:26 GMT</pubDate>
    <dc:creator>HiroshiSatoh</dc:creator>
    <dc:date>2019-07-10T04:28:26Z</dc:date>
    <item>
      <title>How to filter results using fields from lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-results-using-fields-from-lookup-file/m-p/381116#M111495</link>
      <description>&lt;P&gt;I have a challenge in front of me that I can't figure out.  I spent a few hours searching 'answers' and made some headway but I need some help on a sticking point...&lt;/P&gt;

&lt;P&gt;The problem:  We need to be able to quantify "new" hosts that are found on our network every 30 days.  To do this I have connected Splunk with Tenable SecurityCenter (using the add-on) to feed Splunk all the data we need to solve this problem.  &lt;/P&gt;

&lt;P&gt;The solution:  I have created two searches.  &lt;/P&gt;

&lt;P&gt;1) The first search creates the lookup file that contains the previously discovered IP addresses and hostnames (outputlookup append=t).  The time range for this scan is -90d@d to -31d@d&lt;/P&gt;

&lt;P&gt;2) The second search is where I have run into a problem.  The second search should take the lookup table created in the first search, compare the fields containing the IP and hostname data and if it finds a match exclude it from the search results. The time range of this search is -30d@d to now.  This should result in only "new" hosts or hosts found in the most recent scan.  &lt;/P&gt;

&lt;P&gt;The second search is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=bar | dedup ip dnsName | rename ip as IP dnsName as Hostname | lookup foobar ip OUTPUT ip | search NOT (ip or dnsName)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gets me halfway there, but I really need to exclude both ip and dnsName.  How do add a second "output" to the lookup command?  If I simply put it directly after the first I get an error.  &lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 16:42:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-results-using-fields-from-lookup-file/m-p/381116#M111495</guid>
      <dc:creator>chrisray_view</dc:creator>
      <dc:date>2019-07-08T16:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter results using fields from lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-results-using-fields-from-lookup-file/m-p/381117#M111496</link>
      <description>&lt;P&gt;What error do you get when you try &lt;CODE&gt;... | lookup foobar ip OUTPUT ip dnsname | ...&lt;/CODE&gt; ?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 17:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-results-using-fields-from-lookup-file/m-p/381117#M111496</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-07-08T17:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter results using fields from lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-results-using-fields-from-lookup-file/m-p/381118#M111497</link>
      <description>&lt;P&gt;When I did that...I didn't get an error.  &lt;/P&gt;

&lt;P&gt;I have however restructured the search:&lt;/P&gt;

&lt;P&gt;' index=foo sourcetype=bar | dedup ip dnsName | lookup foobar ip dnsName OUTPUT ip dnsName | search NOT (ip OR dnsName) | table ip dnsName'&lt;/P&gt;

&lt;P&gt;This appears to be working as I need it to, but I need to verify the output is correct (working on that).  &lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 17:21:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-results-using-fields-from-lookup-file/m-p/381118#M111497</guid>
      <dc:creator>chrisray_view</dc:creator>
      <dc:date>2019-07-09T17:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter results using fields from lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-results-using-fields-from-lookup-file/m-p/381119#M111498</link>
      <description>&lt;P&gt;How's this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=foo sourcetype=bar NOT [|inputlookup foobar |table ip,dnsName]
| dedup ip dnsName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 04:28:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-results-using-fields-from-lookup-file/m-p/381119#M111498</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2019-07-10T04:28:26Z</dc:date>
    </item>
  </channel>
</rss>

