<?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 Quickly find the time since the last event logged by a host in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Quickly-find-the-time-since-the-last-event-logged-by-a-host/m-p/81818#M20756</link>
    <description>&lt;P&gt;We are trying to monitor the hosts to ensure they have not stopped logging events.    The search being used is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;*|stats max(EVENT_TIMESTAMP) AS LastTime by WEB_SERVER
 |convert timeformat="%Y%m%d %H:%M:%S" mktime(LastTime)
 |eval MinutesAgo=now()-LastTime
 |convert timeformat="%M:%S" ctime(MinutesAgo)
 |fields WEB_SERVER, MinutesAgo
 |sort -MinutesAgo
 |table WEB_SERVER, MinutesAgo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I expect that there is a much more efficient way of doing this, probably going after some of the metadata that is stored in Splunk along with the log event.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2011 23:51:13 GMT</pubDate>
    <dc:creator>approachct</dc:creator>
    <dc:date>2011-04-14T23:51:13Z</dc:date>
    <item>
      <title>Quickly find the time since the last event logged by a host</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Quickly-find-the-time-since-the-last-event-logged-by-a-host/m-p/81818#M20756</link>
      <description>&lt;P&gt;We are trying to monitor the hosts to ensure they have not stopped logging events.    The search being used is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;*|stats max(EVENT_TIMESTAMP) AS LastTime by WEB_SERVER
 |convert timeformat="%Y%m%d %H:%M:%S" mktime(LastTime)
 |eval MinutesAgo=now()-LastTime
 |convert timeformat="%M:%S" ctime(MinutesAgo)
 |fields WEB_SERVER, MinutesAgo
 |sort -MinutesAgo
 |table WEB_SERVER, MinutesAgo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I expect that there is a much more efficient way of doing this, probably going after some of the metadata that is stored in Splunk along with the log event.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2011 23:51:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Quickly-find-the-time-since-the-last-event-logged-by-a-host/m-p/81818#M20756</guid>
      <dc:creator>approachct</dc:creator>
      <dc:date>2011-04-14T23:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Quickly find the time since the last event logged by a host</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Quickly-find-the-time-since-the-last-event-logged-by-a-host/m-p/81819#M20757</link>
      <description>&lt;P&gt;this search looks at the recentTime and provides a table of hosts sorted by the last time they were heard from:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts | sort recentTime desc | convert ctime(recentTime) as Recent_Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or, you could enable the Deployment Monitor app and configure it to alert you when forwarders haven't been heard from: &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/Deploy/Troubleshootyourdeployment" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/Deploy/Troubleshootyourdeployment&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2011 02:53:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Quickly-find-the-time-since-the-last-event-logged-by-a-host/m-p/81819#M20757</guid>
      <dc:creator>piebob</dc:creator>
      <dc:date>2011-04-15T02:53:36Z</dc:date>
    </item>
  </channel>
</rss>

