<?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: Alerting for zero events in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alerting-for-zero-events/m-p/91855#M1278</link>
    <description>&lt;P&gt;If a host has no events, it will not be listed at all.&lt;/P&gt;

&lt;P&gt;To proceed, you have to save a static list of the hosts, by example in a lookup file or a csv file. (See outputlookup, outputcsv, inputlookup, inputcsv)&lt;BR /&gt;
and use this lookup as a &lt;CODE&gt;| JOIN type=outer host&lt;/CODE&gt; to populate the other results, then the missing hosts will be displayed.&lt;BR /&gt;
see &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Join"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Join&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;here is an example with csv.&lt;BR /&gt;
to generate the list once a week over all the week events :&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;earliest=-1w@w latest=@w | dedup host | stats count AS lastweek by host | outputcsv lastweekhostlist.csv&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;to use this list with last hour event list &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;earliest=-1h latest=now | dedup host | stats count AS today by host | JOIN type=outer host [ | inputcsv lastweekhostlist.csv ] | fillnull value=0 today lastweek | where lastweek&amp;gt;0 AND today=0&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;FYI, we use the dedup host to keep only 1 event per hosts to be faster, but you could remove it and use the actual count of events.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Oct 2012 15:54:08 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2012-10-16T15:54:08Z</dc:date>
    <item>
      <title>Alerting for zero events</title>
      <link>https://community.splunk.com/t5/Alerting/Alerting-for-zero-events/m-p/91854#M1277</link>
      <description>&lt;P&gt;we want a search to execute every 20 minutes that looks at the past 20 minutes and ensures that events have been written to the log file by host. &lt;/P&gt;

&lt;P&gt;This search returns no results.&lt;BR /&gt;
sourcetype="PROD_PSI_HR_UNISYS_RTENGINE_DBG" | timechart count span=20m by host | where count=0&lt;/P&gt;

&lt;P&gt;When I remove the "by host", the search below only works for a search for the past 4 hours but when I change it to 60 minutes, it stops returning results.    It definitely doesn't work for the past 20 minutes.&lt;BR /&gt;&lt;BR /&gt;
sourcetype="PROD_PSI_HR_UNISYS_RTENGINE_DBG" | timechart count span=20m | where count=0&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:38:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alerting-for-zero-events/m-p/91854#M1277</guid>
      <dc:creator>peter_gianusso</dc:creator>
      <dc:date>2020-09-28T12:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Alerting for zero events</title>
      <link>https://community.splunk.com/t5/Alerting/Alerting-for-zero-events/m-p/91855#M1278</link>
      <description>&lt;P&gt;If a host has no events, it will not be listed at all.&lt;/P&gt;

&lt;P&gt;To proceed, you have to save a static list of the hosts, by example in a lookup file or a csv file. (See outputlookup, outputcsv, inputlookup, inputcsv)&lt;BR /&gt;
and use this lookup as a &lt;CODE&gt;| JOIN type=outer host&lt;/CODE&gt; to populate the other results, then the missing hosts will be displayed.&lt;BR /&gt;
see &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Join"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Join&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;here is an example with csv.&lt;BR /&gt;
to generate the list once a week over all the week events :&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;earliest=-1w@w latest=@w | dedup host | stats count AS lastweek by host | outputcsv lastweekhostlist.csv&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;to use this list with last hour event list &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;earliest=-1h latest=now | dedup host | stats count AS today by host | JOIN type=outer host [ | inputcsv lastweekhostlist.csv ] | fillnull value=0 today lastweek | where lastweek&amp;gt;0 AND today=0&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;FYI, we use the dedup host to keep only 1 event per hosts to be faster, but you could remove it and use the actual count of events.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 15:54:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alerting-for-zero-events/m-p/91855#M1278</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-10-16T15:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Alerting for zero events</title>
      <link>https://community.splunk.com/t5/Alerting/Alerting-for-zero-events/m-p/91856#M1279</link>
      <description>&lt;P&gt;sorry...lets forget the hosts problem...it's really the query sourcetype="PROD_PSI_HR_UNISYS_RTENGINE_DBG" | timechart count span=20m | where count=0 that's the problem&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:38:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alerting-for-zero-events/m-p/91856#M1279</guid>
      <dc:creator>peter_gianusso</dc:creator>
      <dc:date>2020-09-28T12:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Alerting for zero events</title>
      <link>https://community.splunk.com/t5/Alerting/Alerting-for-zero-events/m-p/91857#M1280</link>
      <description>&lt;P&gt;actually the timechart by host will return a table like :&lt;BR /&gt;
&lt;CODE&gt;timestamp host1 host2 host3&lt;/CODE&gt;&lt;BR /&gt;
therefore there is not count columns to filter on.&lt;/P&gt;

&lt;P&gt;try to replace by&lt;BR /&gt;
&lt;CODE&gt;| bucket _time span=20m | stats count by _time host&lt;/CODE&gt;&lt;BR /&gt;
that will return a table like&lt;BR /&gt;
&lt;CODE&gt;timestamp count host&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 16:07:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alerting-for-zero-events/m-p/91857#M1280</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-10-16T16:07:32Z</dc:date>
    </item>
  </channel>
</rss>

