<?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: Create an alert if error rate is  over 10 ( or X number ) for 15min continusly. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/513965#M144252</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;have you tried streamstats with time_window?&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
    <pubDate>Thu, 13 Aug 2020 18:33:19 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2020-08-13T18:33:19Z</dc:date>
    <item>
      <title>Create an alert if error rate is  over 10 ( or X number ) for 15min continusly.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/513895#M144230</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;I have this query that reports&amp;nbsp; the status code error rates.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=apache_core  userAgent!="nginx/*" source="*access.log*"  requestURI!="/web/app*" NOT (requestURI="/api/xyz/*"  OR requestURI="/api/yyy/*"  AND statusCode=404) earliest=-30m latest=now 
| stats count(eval(statusCode&amp;gt;=400)) as errors, count as total
| eval ErrorRate = errors * 100 / total | fields ErrorRate&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works , but&amp;nbsp; looks like it is taking an average of error rate&amp;nbsp; in last 30 mins and reports&amp;nbsp; over&amp;nbsp; the threshold&amp;nbsp; if there is a onetime spike...&lt;/P&gt;&lt;P&gt;What I want&amp;nbsp; is&amp;nbsp; to&amp;nbsp; &amp;nbsp;Alert , only if the Error Rate&amp;nbsp; is&amp;nbsp; higher than threshold for&amp;nbsp; continuous&amp;nbsp; 10mins&amp;nbsp; &amp;nbsp;in last 30mins OR 1 hr.&lt;/P&gt;&lt;P&gt;&amp;nbsp;How can I achieve that ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;DD&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 12:25:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/513895#M144230</guid>
      <dc:creator>dpdwibedy</dc:creator>
      <dc:date>2020-08-13T12:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Create an alert if error rate is  over 10 ( or X number ) for 15min continusly.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/513930#M144240</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/65095"&gt;@dpdwibedy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;This will not solve the exact solution which you are looking but we are handling the same kind of situation in our environment as below&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=apache_core  userAgent!="nginx/*" source="*access.log*"  requestURI!="/web/app*" NOT (requestURI="/api/xyz/*"  OR requestURI="/api/yyy/*"  AND statusCode=404) earliest=-30m latest=now 
| timechart span=5m count(eval(statusCode&amp;gt;=400)) as errors, count as total
| eval ErrorRate = errors * 100 / total | fields _time,ErrorRate
| where ErrorRate &amp;gt; Threshold&lt;/LI-CODE&gt;&lt;P&gt;And if you want to send an alert if it is greater than 15 mins, then you need to configure the alert as trigger the alert if the result has more than 2 rows. Then the alert will trigger if it 3 times crosses the threshold in the 30 mins window.&lt;BR /&gt;&lt;BR /&gt;Explanation: The above query split the 30 minutes window into 5 mins window and we are checking if 3 (5 mins) window is greater than the threshold, the alert will trigger. So it solves our problem.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 14:47:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/513930#M144240</guid>
      <dc:creator>impurush</dc:creator>
      <dc:date>2020-08-13T14:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create an alert if error rate is  over 10 ( or X number ) for 15min continusly.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/513965#M144252</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;have you tried streamstats with time_window?&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 18:33:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/513965#M144252</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-08-13T18:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Create an alert if error rate is  over 10 ( or X number ) for 15min continusly.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/513992#M144266</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;: Nope.&lt;/P&gt;&lt;P&gt;I am not good in Splunk queries . Could you give me an example ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;DD&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 21:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/513992#M144266</guid>
      <dc:creator>dpdwibedy</dc:creator>
      <dc:date>2020-08-13T21:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create an alert if error rate is  over 10 ( or X number ) for 15min continusly.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/516097#M144963</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am still facing issue here . Can some one give me some examples ?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;DD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 17:47:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/516097#M144963</guid>
      <dc:creator>dpdwibedy</dc:creator>
      <dc:date>2020-08-25T17:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create an alert if error rate is  over 10 ( or X number ) for 15min continusly.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/516130#M144979</link>
      <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;index=apache_core&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;userAgent!="nginx/*" source="*access.log*"&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;requestURI!="/web/app*" NOT (requestURI="/api/xyz/*"&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;OR requestURI="/api/yyy/*"&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;AND statusCode=404) earliest=-30m latest=now &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;| bin _time span=10m&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;| stats count(eval(statusCode&amp;gt;=400)) as errors, count as total by _time&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;| eval ErrorRate = errors * 100 / total | fields ErrorRate _time&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;| where ErrorRate &amp;gt; yourthreshhold&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 19:06:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/516130#M144979</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-25T19:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create an alert if error rate is  over 10 ( or X number ) for 15min continusly.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/516145#M145013</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It should be something like this. I haven't your data so I cannot test exactly with it.&lt;/P&gt;&lt;LI-CODE lang="java"&gt;index=apache_core  userAgent!="nginx/*" source="*access.log*"  requestURI!="/web/app*" NOT (requestURI="/api/xyz/*"  OR requestURI="/api/yyy/*"  AND statusCode=404) earliest=-30m latest=now 
| streamstats time_span=10m count(eval(statusCode&amp;gt;=400)) as errors, count as total
| eval ErrorRate = errors * 100 / total | fields _time,ErrorRate
| where ErrorRate &amp;gt; Threshold&lt;/LI-CODE&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 20:51:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-an-alert-if-error-rate-is-over-10-or-X-number-for-15min/m-p/516145#M145013</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-08-25T20:51:51Z</dc:date>
    </item>
  </channel>
</rss>

