<?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: Alert or Show when a host is down from any index in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118379#M1777</link>
    <description>&lt;P&gt;All the hosts (whether they are sending data or not) send heartbeat to indexer in _internal index. you can query that to identify if a host is down or not.&lt;/P&gt;

&lt;P&gt;index=_internal source=*metrics.log group=tcpin_connections earliest=-7d@d &lt;BR /&gt;
| eval sourceHost=coalesce(hostname, sourceHost) &lt;BR /&gt;
| eval age = (now() - _time ) &lt;BR /&gt;
|stats first(age) as age,  first(_time) as LastTime by sourceHost &lt;BR /&gt;
| convert ctime(LastTime) as "Last Active On" &lt;BR /&gt;
| eval Status= case(age &amp;lt; XXX,"Running",age &amp;gt; XXX,"DOWN") &lt;/P&gt;

&lt;P&gt;Where XXX=duration in second for which is their are no heartbeat from host, the host is down. Typically  is can be 2-3 min (120 or 180)&lt;/P&gt;</description>
    <pubDate>Mon, 28 Oct 2013 18:50:26 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2013-10-28T18:50:26Z</dc:date>
    <item>
      <title>Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118378#M1776</link>
      <description>&lt;P&gt;I have multiple indexes that I would like to look across all of them see when a host stops sending logs or down within a 24 hour window.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 16:45:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118378#M1776</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2013-10-28T16:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118379#M1777</link>
      <description>&lt;P&gt;All the hosts (whether they are sending data or not) send heartbeat to indexer in _internal index. you can query that to identify if a host is down or not.&lt;/P&gt;

&lt;P&gt;index=_internal source=*metrics.log group=tcpin_connections earliest=-7d@d &lt;BR /&gt;
| eval sourceHost=coalesce(hostname, sourceHost) &lt;BR /&gt;
| eval age = (now() - _time ) &lt;BR /&gt;
|stats first(age) as age,  first(_time) as LastTime by sourceHost &lt;BR /&gt;
| convert ctime(LastTime) as "Last Active On" &lt;BR /&gt;
| eval Status= case(age &amp;lt; XXX,"Running",age &amp;gt; XXX,"DOWN") &lt;/P&gt;

&lt;P&gt;Where XXX=duration in second for which is their are no heartbeat from host, the host is down. Typically  is can be 2-3 min (120 or 180)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 18:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118379#M1777</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-10-28T18:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118380#M1778</link>
      <description>&lt;P&gt;I tried this search out and wasn't able to yield any results. I tried changing the XXX to differents seconds and still didn't yield any results.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 19:12:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118380#M1778</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2013-10-28T19:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118381#M1779</link>
      <description>&lt;P&gt;Or you can look at the metadata to see when a host last sent some data. The example below lists hosts that have not sent data in the last day (86400 seconds). Should be significantly quicker than searching through the metrics logs.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts |where recentTime &amp;lt; now() - 86400 | eval lastSeen = strftime(recentTime, "%F %T") | fields + host lastSeen
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 19:15:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118381#M1779</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-28T19:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118382#M1780</link>
      <description>&lt;P&gt;This worked fine, but it left out some host. There's a host that's not showing that I know isn't reporting. Hasn't been reporting for over 3 days now.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 19:24:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118382#M1780</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2013-10-28T19:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118383#M1781</link>
      <description>&lt;P&gt;does it show with only the first part?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| metadata type=hosts&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 19:27:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118383#M1781</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-28T19:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118384#M1782</link>
      <description>&lt;P&gt;It shows with only the first part, but not with the rest.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 19:29:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118384#M1782</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2013-10-28T19:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118385#M1783</link>
      <description>&lt;P&gt;Ok. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| metadata type=hosts | eval lastSeen = strftime(recentTime, "%F %T") | fields + host lastSeen&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 19:31:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118385#M1783</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-28T19:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118386#M1784</link>
      <description>&lt;P&gt;Ok, this one shows everything. It doesn't just show ones that are not loggin or down. Is it possible to show only the ones that are down or not logging.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 19:37:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118386#M1784</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2013-10-28T19:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118387#M1785</link>
      <description>&lt;P&gt;well, yes, that is the purpose of the &lt;CODE&gt;where&lt;/CODE&gt; statement in the original query. However, does &lt;CODE&gt;lastSeen&lt;/CODE&gt; for your 'missing' host seem correct?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 20:14:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118387#M1785</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-28T20:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118388#M1786</link>
      <description>&lt;P&gt;Yes it worked.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 20:18:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118388#M1786</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2013-10-28T20:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118389#M1787</link>
      <description>&lt;P&gt;I know this is a bit dated, but I was interested in finding hosts that "suddenly stop reporting to splunk" and I found this answer.&lt;/P&gt;

&lt;P&gt;When I run this search everything looks fine, and it makes sense. But I decided to test this by issuing a stop command on one of my forwarding agents. That device no longer shows up in the list at all instead of showing up with a "down" status. &lt;/P&gt;

&lt;P&gt;Can anyone take a stab at why that would happen? (I haven't altered the search except to add seconds where there are XXX's)&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2014 15:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118389#M1787</guid>
      <dc:creator>thelen_m_kevin</dc:creator>
      <dc:date>2014-08-28T15:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118390#M1788</link>
      <description>&lt;P&gt;Did it show the host before you put it down (with same search)? The query depends on existence of fields hostname OR sourceHost from the events from that host (its used in stats so if either of the field is null they won't show up.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2014 15:30:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118390#M1788</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-28T15:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Alert or Show when a host is down from any index</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118391#M1789</link>
      <description>&lt;P&gt;@somesoni2, do we to run your search on Indexer? When I tried running this on one of my search head, I was getting status of my splunk servers but not forwarders?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 15:42:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-or-Show-when-a-host-is-down-from-any-index/m-p/118391#M1789</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2016-11-10T15:42:46Z</dc:date>
    </item>
  </channel>
</rss>

