<?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: Custom alert condition in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Custom-alert-condition/m-p/130358#M2052</link>
    <description>&lt;P&gt;By using append you're getting two rows in your result, while eval will operate on each row individually. Put this before your eval:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats first(prevday) as prevday first(currday) as currday | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will collapse the two rows into one, letting eval see both columns properly.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2014 00:39:17 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-01-30T00:39:17Z</dc:date>
    <item>
      <title>Custom alert condition</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-alert-condition/m-p/130357#M2051</link>
      <description>&lt;P&gt;I want to compare the results from latest 4 hrs today with the results from the same time yesterday and want to set an alert if today's result drops by 20 percent.&lt;/P&gt;

&lt;P&gt;My search string is:&lt;/P&gt;

&lt;P&gt;index="abcd" earliest=-28h latest=-24h | stats count as prevday | &lt;BR /&gt;
append [ search index="abcd" earliest=-4h latest=now | stats count as currday] | eval diff = (abs(prevday - currday)/prevday)*100&lt;/P&gt;

&lt;P&gt;Using this search string I could store the results in respective variables prevday and currday.. But I could not successfully set an alert by mentioning the custom condition diff &amp;gt; 20. Where am I doing a mistake? What do I need to specify in alert condition so that I will get an alert if diff &amp;gt; 20 ?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2014 23:39:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-alert-condition/m-p/130357#M2051</guid>
      <dc:creator>ranjani</dc:creator>
      <dc:date>2014-01-29T23:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Custom alert condition</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-alert-condition/m-p/130358#M2052</link>
      <description>&lt;P&gt;By using append you're getting two rows in your result, while eval will operate on each row individually. Put this before your eval:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats first(prevday) as prevday first(currday) as currday | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will collapse the two rows into one, letting eval see both columns properly.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2014 00:39:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-alert-condition/m-p/130358#M2052</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-01-30T00:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Custom alert condition</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-alert-condition/m-p/130359#M2053</link>
      <description>&lt;P&gt;Oh cool. This really worked for me. Appreciate your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2014 17:58:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-alert-condition/m-p/130359#M2053</guid>
      <dc:creator>ranjani</dc:creator>
      <dc:date>2014-01-30T17:58:40Z</dc:date>
    </item>
  </channel>
</rss>

