<?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 find hosts without logs by time? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-hosts-without-logs-by-time/m-p/388938#M69616</link>
    <description>&lt;P&gt;Hi @skottska,&lt;BR /&gt;
you have to create a lookup (called e.g. perimeter.csv, containing at least one field, host, and eventually other information that are useful for you, e.g. from a CMDB) and run something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metasearch your_search
| eval host=lower(host)
| stats count BY host
| append [ | inputlookup perimeter.csv | eval count=0, eval host=lower(host) | fields host ]
| stats sum(count) AS total BY host
| where total=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's better to have the search as main search and the lookup in the append because there's the limit of 50,000 results in subsearches and you can use the command &lt;CODE&gt;| metasearch&lt;/CODE&gt; to speed your search.&lt;/P&gt;

&lt;P&gt;If you don't use the last row (&lt;CODE&gt;| where total=0&lt;/CODE&gt;), you can have the status of you perimeter, that you can also display in graphic mode with icons.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2019 08:13:46 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2019-12-19T08:13:46Z</dc:date>
    <item>
      <title>How to find hosts without logs by time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-hosts-without-logs-by-time/m-p/388936#M69614</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have a query which finds hosts without logs for the whole search and it looks like this:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;| inputlookup hosts.csv  | search NOT [search index=prod  ("successfully placed") | dedup host | table host]&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;What I would like to be able to do is to split this over _time so that I can search for say "over the last 24 hours, which minutes have no logs by host".&lt;/P&gt;

&lt;P&gt;I've tested with trying to squeeze in "bucket _time span=1m" but I can't figure out how to combine this with my host.csv lookup.&lt;/P&gt;

&lt;P&gt;Anyone got any tips?&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 08:50:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-hosts-without-logs-by-time/m-p/388936#M69614</guid>
      <dc:creator>skottska</dc:creator>
      <dc:date>2019-05-22T08:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to find hosts without logs by time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-hosts-without-logs-by-time/m-p/388937#M69615</link>
      <description>&lt;P&gt;This is what I wrote for my system, the asset file contains the short name as Host and an Environment Column. &lt;/P&gt;

&lt;P&gt;| inputlookup MyAssets.csv | append [search * |  rex field=host "^(?\w*).?" | stats count by Host ] | fillnull value=0 count | stats values(Environment) as Environment, sum(count) as Events by Host | fillnull value="Unknown Asset Reporting" Environment&lt;/P&gt;

&lt;P&gt;Hosts with 0 events are not reporting, and Hosts with Unknown environments are unknown assets. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 18:42:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-hosts-without-logs-by-time/m-p/388937#M69615</guid>
      <dc:creator>drodman29</dc:creator>
      <dc:date>2019-12-18T18:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to find hosts without logs by time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-hosts-without-logs-by-time/m-p/388938#M69616</link>
      <description>&lt;P&gt;Hi @skottska,&lt;BR /&gt;
you have to create a lookup (called e.g. perimeter.csv, containing at least one field, host, and eventually other information that are useful for you, e.g. from a CMDB) and run something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metasearch your_search
| eval host=lower(host)
| stats count BY host
| append [ | inputlookup perimeter.csv | eval count=0, eval host=lower(host) | fields host ]
| stats sum(count) AS total BY host
| where total=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's better to have the search as main search and the lookup in the append because there's the limit of 50,000 results in subsearches and you can use the command &lt;CODE&gt;| metasearch&lt;/CODE&gt; to speed your search.&lt;/P&gt;

&lt;P&gt;If you don't use the last row (&lt;CODE&gt;| where total=0&lt;/CODE&gt;), you can have the status of you perimeter, that you can also display in graphic mode with icons.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 08:13:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-hosts-without-logs-by-time/m-p/388938#M69616</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-12-19T08:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to find hosts without logs by time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-hosts-without-logs-by-time/m-p/388939#M69617</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count WHERE index=* BY host _time span=1m
| timechart limit=0 span=1m first(count) AS count BY host
| fillnull value=0
| untable _time host count
| where count=="0"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I do not see any reason to filter, but if you do, then add this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| lookup hosts.csv host OUTPUT host AS found
| where isnotnull(found)
| fields - found
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Dec 2019 10:08:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-hosts-without-logs-by-time/m-p/388939#M69617</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-20T10:08:11Z</dc:date>
    </item>
  </channel>
</rss>

