<?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: Anomaly or Trend detection and then trigger an alert in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Anomaly-or-Trend-detection-and-then-trigger-an-alert/m-p/321785#M10854</link>
    <description>&lt;P&gt;From a very basic approach, you can find the average of all numbers then use an eval to multiply the upper and lower boundries then set an alert on it like this &lt;/P&gt;

&lt;P&gt;This will just get you started. You will also need to find the standard deviation and set your boundries&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search 
| timechart avg(KEYS) AS Keys
| eval Upper=Keys*1.1
| eval Lower=Keys*0.9
|  timechart avg(Keys) AS pred max(upper) AS upper max(lower) AS lower
|  eval anomoaly_upper=if('pred'&amp;gt;'upper',"Alert - High Value","")
|  eval anomoaly_lower=if('pred'&amp;lt;'lower',"Alert - Low Value","")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Apr 2018 00:20:25 GMT</pubDate>
    <dc:creator>skoelpin</dc:creator>
    <dc:date>2018-04-06T00:20:25Z</dc:date>
    <item>
      <title>Anomaly or Trend detection and then trigger an alert</title>
      <link>https://community.splunk.com/t5/Alerting/Anomaly-or-Trend-detection-and-then-trigger-an-alert/m-p/321784#M10853</link>
      <description>&lt;P&gt;Assume i have daily records about an amount of keys. &lt;BR /&gt;
What would be the search to trigger an alert condition if changes are seen by say +/- 10% ?&lt;/P&gt;

&lt;P&gt;Sample records, the best case case would be if the alert get triggered at 31-03-2018, the sooner the better.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;14-03-2018 05:15:20 KEYS=663312
15-03-2018 05:15:17 KEYS=652278
16-03-2018 05:15:21 KEYS=665166
17-03-2018 05:15:21 KEYS=665034
18-03-2018 05:15:22 KEYS=664038
19-03-2018 05:15:21 KEYS=664266
20-03-2018 05:15:21 KEYS=663948
21-03-2018 05:15:22 KEYS=665178
22-03-2018 05:15:24 KEYS=666198
23-03-2018 05:15:24 KEYS=665106
24-03-2018 05:15:20 KEYS=663720
25-03-2018 23:15:19 KEYS=663912
26-03-2018 23:15:22 KEYS=665148
27-03-2018 23:15:22 KEYS=664476
28-03-2018 05:15:21 KEYS=663828
29-03-2018 23:15:16 KEYS=651597
30-03-2018 05:15:21 KEYS=650331
31-03-2018 05:14:16 KEYS=420530
01-04-2018 05:14:17 KEYS=419333
02-04-2018 05:14:14 KEYS=416444
03-04-2018 05:14:17 KEYS=416354
04-04-2018 05:14:12 KEYS=409496
05-04-2018 05:14:13 KEYS=409544
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried something like&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;KEYS| timechart avg(KEYS) as Size | anomalydetection action=summary&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;The outup field   &lt;STRONG&gt;num_anomalies&lt;/STRONG&gt;  from anomalydetection  would be perfect to use as an alert trigger but the number is constant. Something is wrong here.&lt;/P&gt;

&lt;P&gt;Any ideas please?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 21:04:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Anomaly-or-Trend-detection-and-then-trigger-an-alert/m-p/321784#M10853</guid>
      <dc:creator>mkrauss1</dc:creator>
      <dc:date>2018-04-05T21:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Anomaly or Trend detection and then trigger an alert</title>
      <link>https://community.splunk.com/t5/Alerting/Anomaly-or-Trend-detection-and-then-trigger-an-alert/m-p/321785#M10854</link>
      <description>&lt;P&gt;From a very basic approach, you can find the average of all numbers then use an eval to multiply the upper and lower boundries then set an alert on it like this &lt;/P&gt;

&lt;P&gt;This will just get you started. You will also need to find the standard deviation and set your boundries&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search 
| timechart avg(KEYS) AS Keys
| eval Upper=Keys*1.1
| eval Lower=Keys*0.9
|  timechart avg(Keys) AS pred max(upper) AS upper max(lower) AS lower
|  eval anomoaly_upper=if('pred'&amp;gt;'upper',"Alert - High Value","")
|  eval anomoaly_lower=if('pred'&amp;lt;'lower',"Alert - Low Value","")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Apr 2018 00:20:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Anomaly-or-Trend-detection-and-then-trigger-an-alert/m-p/321785#M10854</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-04-06T00:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Anomaly or Trend detection and then trigger an alert</title>
      <link>https://community.splunk.com/t5/Alerting/Anomaly-or-Trend-detection-and-then-trigger-an-alert/m-p/321786#M10855</link>
      <description>&lt;P&gt;Thank you for this basic approach, this is what i'm looking for. However, i thought that Splunk has this kind&lt;BR /&gt;
of functions already in place.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 07:50:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Anomaly-or-Trend-detection-and-then-trigger-an-alert/m-p/321786#M10855</guid>
      <dc:creator>mkrauss1</dc:creator>
      <dc:date>2018-04-06T07:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Anomaly or Trend detection and then trigger an alert</title>
      <link>https://community.splunk.com/t5/Alerting/Anomaly-or-Trend-detection-and-then-trigger-an-alert/m-p/321787#M10856</link>
      <description>&lt;P&gt;Not out of the box, you would either have to build it in core SPL like we did above or you would need to use the MLTK. &lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 14:00:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Anomaly-or-Trend-detection-and-then-trigger-an-alert/m-p/321787#M10856</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-04-06T14:00:34Z</dc:date>
    </item>
  </channel>
</rss>

