<?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 on changed ratio between 2 different events? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alert-on-changed-ratio-between-2-different-events/m-p/30398#M295</link>
    <description>&lt;P&gt;Try this;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=your_sourcetype earliest=-5m | stats c AS Total c(eval(status_id="OK")) AS Good c(eval(status_id="ERROR")) AS Bad | eval bad_ratio = Bad/Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then set the search to run every 5 minutes, and alert on Custom Condition;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search bad_ratio &amp;gt; 0.25 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
    <pubDate>Thu, 19 Apr 2012 11:19:31 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2012-04-19T11:19:31Z</dc:date>
    <item>
      <title>Alert on changed ratio between 2 different events?</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-on-changed-ratio-between-2-different-events/m-p/30397#M294</link>
      <description>&lt;P&gt;I have events coming in that has a field called status_id. This field contains the values OK or ERROR. If I look at the last five minutes it's ok to have a ratio of 20% Errors and 80% events with status_id="OK". &lt;/P&gt;

&lt;P&gt;How can I be alerted if the ratio changes to 50% Errors and 50% OK in next 5 minutes?&lt;/P&gt;

&lt;P&gt;The total number of events during a 5 minutes period, can be between 20 and 200 depending on the time of the day.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:41:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-on-changed-ratio-between-2-different-events/m-p/30397#M294</guid>
      <dc:creator>andyk</dc:creator>
      <dc:date>2020-09-28T11:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Alert on changed ratio between 2 different events?</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-on-changed-ratio-between-2-different-events/m-p/30398#M295</link>
      <description>&lt;P&gt;Try this;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=your_sourcetype earliest=-5m | stats c AS Total c(eval(status_id="OK")) AS Good c(eval(status_id="ERROR")) AS Bad | eval bad_ratio = Bad/Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then set the search to run every 5 minutes, and alert on Custom Condition;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search bad_ratio &amp;gt; 0.25 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2012 11:19:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-on-changed-ratio-between-2-different-events/m-p/30398#M295</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-04-19T11:19:31Z</dc:date>
    </item>
  </channel>
</rss>

