<?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: Find Hosts which are not reporting in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119248#M31989</link>
    <description>&lt;P&gt;How about hosts that we've seen as recently as yesterday, but have not reported in since the beginning of the last hour?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts  
| eval lastHour=relative_time(now(),"-1h@h") 
| eval yesterday=relative_time(now(), "-1d@d") 
| where ( recentTime&amp;gt;yesterday AND recentTime&amp;lt;lastHour) 
| eval sinceLast=tostring(now()-recentTime,"duration") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Adjust as needed.&lt;/P&gt;</description>
    <pubDate>Thu, 21 May 2015 13:28:07 GMT</pubDate>
    <dc:creator>jacobwilkins</dc:creator>
    <dc:date>2015-05-21T13:28:07Z</dc:date>
    <item>
      <title>Find Hosts which are not reporting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119245#M31986</link>
      <description>&lt;P&gt;Hi All ,&lt;/P&gt;

&lt;P&gt;I am trying to find the hosts which have not reported for the last 1 hour, so i am using metadata command.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;| metadata type=hosts | eval current=now()| eval lastHour=relative_time(now(),"-1h") | where lastHour &amp;gt; recentTime  | convert ctime(current) as Current_Time, ctime(lastHour) as Last_Hour, ctime(recentTime) as Recent | table Current_Time,Last_Hour,Recent, host&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I am using recentTime because it a loge stream.&lt;/P&gt;

&lt;P&gt;Problem that i am facing is this metadata command shows me all hosts with recentTime before 1 hour. Attached is a screenshot for the same. Mu hosts have reported after that also. Even if i change the limit to 1 day then the search is showing me results for al hosts with recentTime before 1 day.&lt;/P&gt;

&lt;P&gt;Any help !!&lt;/P&gt;

&lt;P&gt;alt text&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:01:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119245#M31986</guid>
      <dc:creator>lohit</dc:creator>
      <dc:date>2020-09-28T20:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Find Hosts which are not reporting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119246#M31987</link>
      <description>&lt;P&gt;Your where clause is reversed.  Using `...|where lastHour&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2015 12:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119246#M31987</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-05-21T12:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Find Hosts which are not reporting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119247#M31988</link>
      <description>&lt;P&gt;Rich&lt;/P&gt;

&lt;P&gt;Thanks but i think i am using right where clause. It states to check recentTime of hosts which have value of less than 1 hour.&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2015 13:02:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119247#M31988</guid>
      <dc:creator>lohit</dc:creator>
      <dc:date>2015-05-21T13:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find Hosts which are not reporting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119248#M31989</link>
      <description>&lt;P&gt;How about hosts that we've seen as recently as yesterday, but have not reported in since the beginning of the last hour?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts  
| eval lastHour=relative_time(now(),"-1h@h") 
| eval yesterday=relative_time(now(), "-1d@d") 
| where ( recentTime&amp;gt;yesterday AND recentTime&amp;lt;lastHour) 
| eval sinceLast=tostring(now()-recentTime,"duration") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Adjust as needed.&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2015 13:28:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119248#M31989</guid>
      <dc:creator>jacobwilkins</dc:creator>
      <dc:date>2015-05-21T13:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Find Hosts which are not reporting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119249#M31990</link>
      <description>&lt;P&gt;My answer was chopped off.  The recentTime and lastHour fields are timestamps, with lastHour set to one hour ago.  Therefore, any timestamp bigger than lastHour is less than one hour old.  That said, I think jacobwilkins has a good answer.&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2015 14:46:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119249#M31990</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-05-21T14:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Find Hosts which are not reporting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119250#M31991</link>
      <description>&lt;P&gt;try this&lt;/P&gt;

&lt;P&gt;|noop |append [ |metadata type=hosts | table *] | append [|metadata type=sourcetypes | table *] | eval t = now() - lastTime  | eval name = coalesce(host,sourcetype)| table name t lastTime totalCount type |rename t as "Seconds since Event" | convert ctime(lastTime) timeformat="%m/%d/%Y %H:%M:%S"&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 15:35:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-Hosts-which-are-not-reporting/m-p/119250#M31991</guid>
      <dc:creator>rameshyedurla</dc:creator>
      <dc:date>2016-01-21T15:35:42Z</dc:date>
    </item>
  </channel>
</rss>

