<?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: Alert if Value over threshold for a certain period of time in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Alert-if-Value-over-threshold-for-a-certain-period-of-time/m-p/486550#M59858</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;|sort _time # this to make it easier for the application team to read the logs when they open the alert so that all the events are in ascending order.
 |bin _time span = 16m
 | stats count by host _time 
 |Where count &amp;gt; 7 # Yeah Should be 7 
 |Eval count = count *2 # only to display the number of minutes the value was above the threshold
| rename count AS "Minutes Over Threshold" host as Host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 Nov 2019 13:19:56 GMT</pubDate>
    <dc:creator>omprakash9998</dc:creator>
    <dc:date>2019-11-19T13:19:56Z</dc:date>
    <item>
      <title>Alert if Value over threshold for a certain period of time</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Alert-if-Value-over-threshold-for-a-certain-period-of-time/m-p/486547#M59855</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I have an event being received once every 2 minutes. I am trying to setup an alert if the Value for the event goes beyond certain threshold for 15 mins or more. I am using the below query. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= x host = y 
|Where Value &amp;gt; Threshold
|sort _time
|bin _time span = 16m
| stats count by host _time
|Where count &amp;gt; 6
|Eval count = count *2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does the above code need any changes to work. &lt;BR /&gt;
Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 18:30:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Alert-if-Value-over-threshold-for-a-certain-period-of-time/m-p/486547#M59855</guid>
      <dc:creator>omprakash9998</dc:creator>
      <dc:date>2019-11-18T18:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if Value over threshold for a certain period of time</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Alert-if-Value-over-threshold-for-a-certain-period-of-time/m-p/486548#M59856</link>
      <description>&lt;P&gt;Some minor edits:&lt;/P&gt;

&lt;P&gt;index= x host = y Value &amp;gt; Threshold &lt;CODE&gt;# moved Value &amp;gt; Threshold up, you also probably want to filter to a very specific set of logs&lt;/CODE&gt;&lt;BR /&gt;
 |sort _time &lt;CODE&gt;# why do you need the sort? Logs are already sorted _time descending by default&lt;/CODE&gt;&lt;BR /&gt;
 | bin _time span = 16m&lt;BR /&gt;
 | stats count by host, _time &lt;CODE&gt;# added a comma for readability&lt;/CODE&gt;&lt;BR /&gt;
 |where count &amp;gt; 7  &lt;CODE&gt;# shouldn't this be 7? you'd want all 8 2 minute chunks to be above the threshold&lt;/CODE&gt;&lt;BR /&gt;
 |eval count = count *2 &lt;CODE&gt;# why do you need this line?&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;There are some other ways to do this (grabbing the earliest time of exceeded value, latest time, taking the diff). I would also urge you to get comfortable testing your alerts, in this case by lowering the threshold and seeing if, for example, a threshold of 0 returns the complete result set of all the hosts you would expect to see.&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 20:21:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Alert-if-Value-over-threshold-for-a-certain-period-of-time/m-p/486548#M59856</guid>
      <dc:creator>aberkow</dc:creator>
      <dc:date>2019-11-18T20:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if Value over threshold for a certain period of time</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Alert-if-Value-over-threshold-for-a-certain-period-of-time/m-p/486549#M59857</link>
      <description>&lt;P&gt;Thank you for the help. &lt;BR /&gt;
How would i go about grabbing the earliest time of exceeded Value and the latest time for the exceeded value and taking the difference.&lt;BR /&gt;
thank you&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 13:14:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Alert-if-Value-over-threshold-for-a-certain-period-of-time/m-p/486549#M59857</guid>
      <dc:creator>omprakash9998</dc:creator>
      <dc:date>2019-11-19T13:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Alert if Value over threshold for a certain period of time</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Alert-if-Value-over-threshold-for-a-certain-period-of-time/m-p/486550#M59858</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;|sort _time # this to make it easier for the application team to read the logs when they open the alert so that all the events are in ascending order.
 |bin _time span = 16m
 | stats count by host _time 
 |Where count &amp;gt; 7 # Yeah Should be 7 
 |Eval count = count *2 # only to display the number of minutes the value was above the threshold
| rename count AS "Minutes Over Threshold" host as Host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Nov 2019 13:19:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Alert-if-Value-over-threshold-for-a-certain-period-of-time/m-p/486550#M59858</guid>
      <dc:creator>omprakash9998</dc:creator>
      <dc:date>2019-11-19T13:19:56Z</dc:date>
    </item>
  </channel>
</rss>

