<?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: Trigger alert on value from predict calculation in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Trigger-alert-on-value-from-predict-calculation/m-p/488830#M8664</link>
    <description>&lt;P&gt;Right, eventually found something that works for me. Not sure if it is the best way but it does work. Below is the query to get the result shown above. &lt;/P&gt;

&lt;P&gt;I simply added in the alert the line&lt;BR /&gt;
&lt;STRONG&gt;| search Prediction &amp;lt; 2000&lt;/STRONG&gt;&lt;BR /&gt;
Just above the last one where I removed the fields I don't want to see.  The result is two dates in the future. the 11th and the 12th of April. So it works and returns the dates to focus on. &lt;/P&gt;

&lt;P&gt;For the alert itself the end result needs to be cleaned up but it does what I need.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxxxx host=xxxxx source="Perfmon:Memory" counter="Available MBytes"
| eval Value=round(Value,0)
| timechart span=1d avg(Value) as "Available MBytes", latest(host) as host, latest(counter) as counter partial=false
| lookup resource_thresholds.csv resource_name AS host, resource_metric AS counter OUTPUTNEW resource_threshold_warning,resource_threshold_critical
| eval Warning=resource_threshold_warning
| eval Critical=resource_threshold_critical
| predict "Available MBytes" as Prediction future_timespan=14
| eval Prediction = round(Prediction,0)
| fields - lower95(Prediction), upper95(Prediction) resource_threshold_warning resource_threshold_critical host counter
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Mar 2020 12:36:47 GMT</pubDate>
    <dc:creator>wbolten</dc:creator>
    <dc:date>2020-03-30T12:36:47Z</dc:date>
    <item>
      <title>Trigger alert on value from predict calculation</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-alert-on-value-from-predict-calculation/m-p/488829#M8663</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to build an alert from the following query. The query collects the counters for memory usage, especially the free amount. It plots a time chart of the last 21 days and performs a prediction over the coming 14 days. The graph itself is perfect. It also shows in the prediction that in the next 14 days we run out of memory. &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8507i4EA48F22DB2005E9/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxxxx host=xxxxx source="Perfmon:Memory" counter="Available MBytes"
| eval Value=(Value/1024)
| timechart span=1d avg(Value) as "Available MBytes", latest(host) as host, latest(counter) as counter
| lookup resource_thresholds.csv resource_name AS host, resource_metric AS counter OUTPUTNEW resource_threshold_warning,resource_threshold_critical
| eval Warning=resource_threshold_warning
| eval Critical=resource_threshold_critical
| predict "Available MBytes" as Prediction future_timespan=14
| eval Prediction = round(Prediction,0)
| fields - lower95(Prediction), upper95(Prediction) resource_threshold_warning resource_threshold_critical host counter
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to run this as a scheduled alert (email, MS Teams) every night and be informed when the prediction hits 0 or lower somewhere in the future 14 days in this case. &lt;/P&gt;

&lt;P&gt;For some reason I cannot seem to get my head around the logic here to trigger the alert. Any suggestions? &lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 09:45:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-alert-on-value-from-predict-calculation/m-p/488829#M8663</guid>
      <dc:creator>wbolten</dc:creator>
      <dc:date>2020-03-09T09:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger alert on value from predict calculation</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-alert-on-value-from-predict-calculation/m-p/488830#M8664</link>
      <description>&lt;P&gt;Right, eventually found something that works for me. Not sure if it is the best way but it does work. Below is the query to get the result shown above. &lt;/P&gt;

&lt;P&gt;I simply added in the alert the line&lt;BR /&gt;
&lt;STRONG&gt;| search Prediction &amp;lt; 2000&lt;/STRONG&gt;&lt;BR /&gt;
Just above the last one where I removed the fields I don't want to see.  The result is two dates in the future. the 11th and the 12th of April. So it works and returns the dates to focus on. &lt;/P&gt;

&lt;P&gt;For the alert itself the end result needs to be cleaned up but it does what I need.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxxxx host=xxxxx source="Perfmon:Memory" counter="Available MBytes"
| eval Value=round(Value,0)
| timechart span=1d avg(Value) as "Available MBytes", latest(host) as host, latest(counter) as counter partial=false
| lookup resource_thresholds.csv resource_name AS host, resource_metric AS counter OUTPUTNEW resource_threshold_warning,resource_threshold_critical
| eval Warning=resource_threshold_warning
| eval Critical=resource_threshold_critical
| predict "Available MBytes" as Prediction future_timespan=14
| eval Prediction = round(Prediction,0)
| fields - lower95(Prediction), upper95(Prediction) resource_threshold_warning resource_threshold_critical host counter
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Mar 2020 12:36:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-alert-on-value-from-predict-calculation/m-p/488830#M8664</guid>
      <dc:creator>wbolten</dc:creator>
      <dc:date>2020-03-30T12:36:47Z</dc:date>
    </item>
  </channel>
</rss>

