<?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 Set an Alert on a Moving Average in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166547#M2734</link>
    <description>&lt;P&gt;That is a reasonable way to test it.&lt;/P&gt;

&lt;P&gt;You can take out the guts and chart it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=vertex7-access RTG_Error="500" earliest=-6d@d latest=@d | bucket _time span=1d | timechart count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you need a more compact view, use a sparkline like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=vertex7-access RTG_Error="500" earliest=-6d@d latest=@d |  stats sparkline(count, 1d)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Have you tried looking at the &lt;CODE&gt;predict&lt;/CODE&gt; command?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://info.prelert.com/blog/anomaly-detective-vs-splunks-anomalies-command-what-is-the-difference"&gt;http://info.prelert.com/blog/anomaly-detective-vs-splunks-anomalies-command-what-is-the-difference&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Aug 2015 14:00:46 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-08-12T14:00:46Z</dc:date>
    <item>
      <title>How to Set an Alert on a Moving Average</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166540#M2727</link>
      <description>&lt;P&gt;I am tracking 500 errors on a daily basis. The average usually remains constant but sometimes it will increase more than 50%. If this happens I want to have Splunk send an alert &lt;/P&gt;

&lt;P&gt;My current search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=vertex7-access RTG_Error="500" earliest=-6d@d latest=@d | timechart count | timewrap d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So if the moving average deviates more then 50% over the average for the past 6 days, I want Splunk to alert me &lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2015 19:49:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166540#M2727</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2015-08-11T19:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to Set an Alert on a Moving Average</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166541#M2728</link>
      <description>&lt;P&gt;For moving averages, If you the search today (Aug-11), you want an alert if the avg from Aug 5-Aug 10, is 50% higher than avg from Aug 4-Aug9 ?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2015 21:55:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166541#M2728</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-11T21:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to Set an Alert on a Moving Average</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166542#M2729</link>
      <description>&lt;P&gt;Yes very close. I want an alert set on a cron schedule to run every 6 hours (It was originally 1 day but now I want it to be 6 hours). So the alert will have an average from [Aug 5th - Aug 10th] and if at anytime that number goes 50% above the ~6 day average then an alert is sent out&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2015 23:07:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166542#M2729</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2015-08-11T23:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Set an Alert on a Moving Average</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166543#M2730</link>
      <description>&lt;P&gt;To add onto this with an example&lt;/P&gt;

&lt;P&gt;From [Aug 5th - Aug 10th] the average number of errors for the day was 90,000&lt;/P&gt;

&lt;P&gt;Say on August 11th the average is 140,000, we are now 50% more than what our average was from [Aug 5th - Aug 10th] and an alert is sent&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2015 23:19:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166543#M2730</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2015-08-11T23:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to Set an Alert on a Moving Average</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166544#M2731</link>
      <description>&lt;P&gt;Run this search every 6 hours for the last 24 hours:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=vertex7-access RTG_Error="500" | stats count | where count &amp;gt;  1.5 * [ search index=vertex7-access RTG_Error="500" earliest=-6d@d latest=@d | bucket _time span=1d | stats count by _time | stats avg(count) as AvgDailyError500Count | return $AvgDailyError500Count ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:36:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166544#M2731</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-12T13:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to Set an Alert on a Moving Average</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166545#M2732</link>
      <description>&lt;P&gt;It's only returning the count over the past 6 days, how should I test this?&lt;/P&gt;

&lt;P&gt;Do you recommend I change this  &lt;CODE&gt;..| where count &amp;gt; 0.5&lt;/CODE&gt; so an alert triggers at 50% of the current average? &lt;/P&gt;

&lt;P&gt;Would it be possible to create a barchart showing the count for each day (over the past 6 days) and have a trendline showing the 6 day average. Then I can have the alert go off if it goes 50% higher? &lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:48:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166545#M2732</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2015-08-12T13:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to Set an Alert on a Moving Average</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166546#M2733</link>
      <description>&lt;P&gt;Hey skoelpin&lt;BR /&gt;
Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=vertex7-access RTG_Error="500" earliest=-6d@d latest=-1@d | timechart span=1d count AS totals | stats avg(totals) AS last_week_avg | appendcols [search index=vertex7-access RTG_Error="500" earliest=-1d@d latest=now | timechart span=1d count AS today_avg] | eval alert = if((today_avg&amp;gt;last_week_avg*1.5),"true","false")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you just need to choose alert if custom condition is met: alert=true&lt;/P&gt;

&lt;P&gt;There might be another solution without subsearches but this should work.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2015 13:55:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166546#M2733</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2015-08-12T13:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to Set an Alert on a Moving Average</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166547#M2734</link>
      <description>&lt;P&gt;That is a reasonable way to test it.&lt;/P&gt;

&lt;P&gt;You can take out the guts and chart it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=vertex7-access RTG_Error="500" earliest=-6d@d latest=@d | bucket _time span=1d | timechart count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you need a more compact view, use a sparkline like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=vertex7-access RTG_Error="500" earliest=-6d@d latest=@d |  stats sparkline(count, 1d)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Have you tried looking at the &lt;CODE&gt;predict&lt;/CODE&gt; command?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://info.prelert.com/blog/anomaly-detective-vs-splunks-anomalies-command-what-is-the-difference"&gt;http://info.prelert.com/blog/anomaly-detective-vs-splunks-anomalies-command-what-is-the-difference&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2015 14:00:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166547#M2734</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-12T14:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to Set an Alert on a Moving Average</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166548#M2735</link>
      <description>&lt;P&gt;I tested this and it worked perfectly. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2015 18:36:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-Set-an-Alert-on-a-Moving-Average/m-p/166548#M2735</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2015-08-13T18:36:22Z</dc:date>
    </item>
  </channel>
</rss>

