<?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 if field value remains above a specific threshold? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437296#M124526</link>
    <description>&lt;P&gt;Hi Nickhillscpl,&lt;/P&gt;

&lt;P&gt;Thank you for the query, it's not quite giving me the results I'm looking for.  I've updated my query to the following: &lt;/P&gt;

&lt;P&gt;| makeresults&lt;BR /&gt;
| stats count by _time&lt;BR /&gt;
| eval lock_count=case(count&amp;gt;500,"alert")&lt;BR /&gt;
| search lock_count=alert&lt;BR /&gt;
| bin _time span=5m &lt;BR /&gt;
| streamstats count window=2 by lock_alert&lt;/P&gt;

&lt;P&gt;Now trying to resolve, if I get two "alerts" in a 5 min time-frame I can generate an alert.  Any suggestions?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:41:06 GMT</pubDate>
    <dc:creator>cquinney</dc:creator>
    <dc:date>2020-09-29T23:41:06Z</dc:date>
    <item>
      <title>How to create an alert if field value remains above a specific threshold?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437292#M124522</link>
      <description>&lt;P&gt;Greetings&lt;/P&gt;

&lt;P&gt;I'm looking to create an alert if a field value consecutively remains above a specific threshold, say 500.  For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time        Field-1
1310         583
1315         678
1320         300
1325         789
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this example, I would get an alert at 1315 but not at 1320 or 1325 as the value was not above 500 consecutively.  Any help in resolving this is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 22:50:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437292#M124522</guid>
      <dc:creator>cquinney</dc:creator>
      <dc:date>2019-03-11T22:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert if field value remains above a specific threshold?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437293#M124523</link>
      <description>&lt;P&gt;There are a few ways to go about this and the optimal solution depends on specifics of your data.&lt;/P&gt;

&lt;P&gt;Do the events come in every five minutes or is that just an example?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 23:48:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437293#M124523</guid>
      <dc:creator>zonistj</dc:creator>
      <dc:date>2019-03-11T23:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert if field value remains above a specific threshold?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437294#M124524</link>
      <description>&lt;P&gt;The data currently comes in every 5 mins. &lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 11:22:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437294#M124524</guid>
      <dc:creator>cquinney</dc:creator>
      <dc:date>2019-03-12T11:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert if field value remains above a specific threshold?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437295#M124525</link>
      <description>&lt;P&gt;Hi @cquinney &lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your search] |dedup 2 sourcetype |where Field-1&amp;gt;500 |eventstats count|where count&amp;gt;1|table Time Field-1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will look at the last two consecutive events, and only include them when the value is &amp;gt; 500.&lt;BR /&gt;
Then eventstats counts how many records you have - more than 1 records, and you get a result&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 11:34:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437295#M124525</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-12T11:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert if field value remains above a specific threshold?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437296#M124526</link>
      <description>&lt;P&gt;Hi Nickhillscpl,&lt;/P&gt;

&lt;P&gt;Thank you for the query, it's not quite giving me the results I'm looking for.  I've updated my query to the following: &lt;/P&gt;

&lt;P&gt;| makeresults&lt;BR /&gt;
| stats count by _time&lt;BR /&gt;
| eval lock_count=case(count&amp;gt;500,"alert")&lt;BR /&gt;
| search lock_count=alert&lt;BR /&gt;
| bin _time span=5m &lt;BR /&gt;
| streamstats count window=2 by lock_alert&lt;/P&gt;

&lt;P&gt;Now trying to resolve, if I get two "alerts" in a 5 min time-frame I can generate an alert.  Any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:41:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437296#M124526</guid>
      <dc:creator>cquinney</dc:creator>
      <dc:date>2020-09-29T23:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an alert if field value remains above a specific threshold?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437297#M124527</link>
      <description>&lt;P&gt;I found an alternate solution by modifying my query to:&lt;/P&gt;

&lt;P&gt;| makeresults&lt;BR /&gt;
| timechart span=5min count&lt;BR /&gt;
| eval hour=strftime(_time,"%H:%M")&lt;BR /&gt;
| streamstats current=f window=2 last(count) as last_count&lt;BR /&gt;
| table hour count last_count&lt;/P&gt;

&lt;P&gt;Then I created an alert condition where count &amp;gt; 500 AND last_count &amp;gt; 500&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-an-alert-if-field-value-remains-above-a-specific/m-p/437297#M124527</guid>
      <dc:creator>cquinney</dc:creator>
      <dc:date>2020-09-29T23:41:11Z</dc:date>
    </item>
  </channel>
</rss>

