<?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 create an alert that adds the previous results to an hourly running total for a 24-hour period in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481298#M134867</link>
    <description>&lt;P&gt;I was thinking about using a summary index with a 24 hour look back each hour, but someone mentioned using an output lookup instead...&lt;/P&gt;</description>
    <pubDate>Tue, 21 Apr 2020 15:17:59 GMT</pubDate>
    <dc:creator>Glasses</dc:creator>
    <dc:date>2020-04-21T15:17:59Z</dc:date>
    <item>
      <title>How to create an alert that adds the previous results to an hourly running total for a 24-hour period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481297#M134866</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
I need to monitor "host failure events" per hour over last 24 hours for a group of 50 hosts.  When the total reaches a threshold like 10 fails, an alert email needs to be sent.  This count and total needs to occur each hour.&lt;/P&gt;

&lt;P&gt;What I want to do is schedule a report to count the fails by each host per hour, save the count, and then add the next hourly count to the previous count.   When any host reaches 10 fails within the 24 hour window, the triggered action needs to send an email.  &lt;/P&gt;

&lt;P&gt;At midnight, I would like to reset the count.&lt;/P&gt;

&lt;P&gt;Any advice appreciated.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 14:19:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481297#M134866</guid>
      <dc:creator>Glasses</dc:creator>
      <dc:date>2020-04-21T14:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert that adds the previous results to an hourly running total for a 24-hour period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481298#M134867</link>
      <description>&lt;P&gt;I was thinking about using a summary index with a 24 hour look back each hour, but someone mentioned using an output lookup instead...&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 15:17:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481298#M134867</guid>
      <dc:creator>Glasses</dc:creator>
      <dc:date>2020-04-21T15:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert that adds the previous results to an hourly running total for a 24-hour period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481299#M134868</link>
      <description>&lt;P&gt;So trying the outputlookup method...  &lt;/P&gt;

&lt;P&gt;I created a lookup called "Failed_Count" with a file.csv that contains 2 fields  host,count.&lt;BR /&gt;
I can run a query like this&amp;gt;&amp;gt;&lt;BR /&gt;
    index=foo "failed" |stats count by host | outputlookup Failed_Count&lt;BR /&gt;
and it updates, but I have no luck adding the previous hour count to the total...&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:06:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481299#M134868</guid>
      <dc:creator>Glasses</dc:creator>
      <dc:date>2020-09-30T05:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert that adds the previous results to an hourly running total for a 24-hour period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481300#M134869</link>
      <description>&lt;P&gt;...|table fields from inputlookup add results from current search to table then | outputlookup... &lt;/P&gt;

&lt;P&gt;I am guessing&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 16:15:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481300#M134869</guid>
      <dc:creator>Glasses</dc:creator>
      <dc:date>2020-04-21T16:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert that adds the previous results to an hourly running total for a 24-hour period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481301#M134870</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=foo "failed" 
| stats min(_time) as _time count by host 
| eval _time=strftime(_time,"%F %H%M")
| outputlookup append=t Failed_Count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's better to add &lt;CODE&gt;_time&lt;/CODE&gt; and use &lt;CODE&gt;outputlookup&lt;/CODE&gt; with &lt;CODE&gt;append=true&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;For alerting:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Failed_Count
| where strptime(_time, "%F %H%M") &amp;gt; relative_time(now(),"-1d")
| stats sum(count) as total by host
| where total &amp;gt; 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If event count &amp;gt; 0, fire alert.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Outputlookup"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Outputlookup&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 22:14:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481301#M134870</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-21T22:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert that adds the previous results to an hourly running total for a 24-hour period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481302#M134871</link>
      <description>&lt;P&gt;WOW that is awesome!!! &lt;/P&gt;

&lt;P&gt;I was going round and round not quite getting it... but that is exactly what I was trying to do...&lt;/P&gt;

&lt;P&gt;although the system admin said that my default query would work as well - running every hour and sending an alert when results are greater than &amp;gt; 1&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;foo&amp;gt; earliest=-24h@h latest=@h "&amp;lt;some bad failure msg&amp;gt;"  |bin _time span=1h |stats count by host _time |eventstats sum(count) as totalCount by host | where totalCount &amp;gt; 10    
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;one followup question, if I keep your outputlook method running, how do I purge the old data after a day or so, because the file might grow to a huge size and cause issues (I am thinking...) &lt;/P&gt;

&lt;P&gt;Thank you very much !!!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 16:31:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481302#M134871</guid>
      <dc:creator>Glasses</dc:creator>
      <dc:date>2020-04-22T16:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert that adds the previous results to an hourly running total for a 24-hour period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481303#M134872</link>
      <description>&lt;P&gt;&lt;A href="https://splunkbase.splunk.com/app/1724/"&gt;https://splunkbase.splunk.com/app/1724/&lt;/A&gt;&lt;BR /&gt;
or delete by script&lt;BR /&gt;
or make another query to check and delete extra rows.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 20:28:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481303#M134872</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-22T20:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert that adds the previous results to an hourly running total for a 24-hour period</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481304#M134873</link>
      <description>&lt;P&gt;thank you! please convert previous to an answer and I will accept&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 20:47:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-that-adds-the-previous-results-to-an/m-p/481304#M134873</guid>
      <dc:creator>Glasses</dc:creator>
      <dc:date>2020-04-22T20:47:35Z</dc:date>
    </item>
  </channel>
</rss>

