<?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: Comparing hosts not reporting to a separate lookup and adding supplemental information in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-hosts-not-reporting-to-a-separate-lookup-and-adding/m-p/271084#M81607</link>
    <description>&lt;P&gt;You also have to add &lt;CODE&gt;| where isnotnull(SomeFieldInYourLookupFile)&lt;/CODE&gt; to strip out the hosts that are not found.  This solution is better than mine because it does not use a subsearch.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Oct 2015 15:02:10 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-10-13T15:02:10Z</dc:date>
    <item>
      <title>Comparing hosts not reporting to a separate lookup and adding supplemental information</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-hosts-not-reporting-to-a-separate-lookup-and-adding/m-p/271081#M81604</link>
      <description>&lt;P&gt;I came across a posting that had the following search which works amazingly well:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata index=* type=hosts | eval age = now()-lastTime | where age &amp;gt; (2*86400) | sort age d | convert ctime(lastTime) | fields age,host,lastTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My question is, how can I take the results of this search and compare it with a lookup?  My dblookup contains a lot of valuable information that a CMDB would contain (Domain   Notes   OS  app_owner   applications    business_unit   host    host_with_fqdn  patch_cycle primary_contact secondary_contact   serial  server_model    server_platform server_status   server_type site)&lt;BR /&gt;
Specifically I am looking to know all the hosts that are present in both the results of the search above, with the lookup table I already have, and pull in the status (retired or active), and possibly supplement the results with some of the additional information that might be valuable in the lookup table.&lt;/P&gt;

&lt;P&gt;Basically inventory control&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:33:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-hosts-not-reporting-to-a-separate-lookup-and-adding/m-p/271081#M81604</guid>
      <dc:creator>LiquidTension</dc:creator>
      <dc:date>2020-09-29T07:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing hosts not reporting to a separate lookup and adding supplemental information</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-hosts-not-reporting-to-a-separate-lookup-and-adding/m-p/271082#M81605</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata index=* type=hosts | eval age = now()-lastTime | where age &amp;gt; (2*86400) | sort age d | convert ctime(lastTime) | fields age,host,lastTime | eval type=metadata | append [|inputlookup max=0 YourLookup | eval type=lookup] | stats values(*) AS * | where mvcount(type)=2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Oct 2015 14:48:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-hosts-not-reporting-to-a-separate-lookup-and-adding/m-p/271082#M81605</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-13T14:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing hosts not reporting to a separate lookup and adding supplemental information</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-hosts-not-reporting-to-a-separate-lookup-and-adding/m-p/271083#M81606</link>
      <description>&lt;P&gt;If you're using dblookup using dbconnect try something like this (&lt;A href="http://docs.splunk.com/Documentation/DBX/1.1.4/DeployDBX/Setupadatabaselookuptable#Create_a_lookup_by_editing_dblookup.conf"&gt;http://docs.splunk.com/Documentation/DBX/1.1.4/DeployDBX/Setupadatabaselookuptable#Create_a_lookup_by_editing_dblookup.conf&lt;/A&gt;)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata index=* type=hosts | eval age = now()-lastTime | where age &amp;gt; (2*86400) | sort age d | convert ctime(lastTime) | fields age,host,lastTime | lookup local=1 yourdblookup host OUTPUT add Your Columns here | table age,host,lastTime Your Columns here
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For regular csv lookup tables, pretty much the same.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata index=* type=hosts | eval age = now()-lastTime | where age &amp;gt; (2*86400) | sort age d | convert ctime(lastTime) | fields age,host,lastTime | lookup  yourdblookup.csv host OUTPUT add Your Columns here | table age,host,lastTime Your Columns here
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Oct 2015 14:52:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-hosts-not-reporting-to-a-separate-lookup-and-adding/m-p/271083#M81606</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-13T14:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing hosts not reporting to a separate lookup and adding supplemental information</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-hosts-not-reporting-to-a-separate-lookup-and-adding/m-p/271084#M81607</link>
      <description>&lt;P&gt;You also have to add &lt;CODE&gt;| where isnotnull(SomeFieldInYourLookupFile)&lt;/CODE&gt; to strip out the hosts that are not found.  This solution is better than mine because it does not use a subsearch.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 15:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-hosts-not-reporting-to-a-separate-lookup-and-adding/m-p/271084#M81607</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-13T15:02:10Z</dc:date>
    </item>
  </channel>
</rss>

