<?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: Why my alerts are sending email if the search result is zero? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296331#M5373</link>
    <description>&lt;P&gt;If you wish to show the trigger condition in your alert email, I would go with @niketnilay's suggestion of using custom trigger condition.&lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2017 17:12:02 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-05-16T17:12:02Z</dc:date>
    <item>
      <title>Why my alerts are sending email if the search result is zero?</title>
      <link>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296326#M5368</link>
      <description>&lt;P&gt;I have set up a bunch of alerts to run every 5min with a time range of the last 15min. &lt;BR /&gt;
Every 5 min I get an email from the alert but when I run the search query it returns me ZERO events.&lt;BR /&gt;
I did specified to only send emails of results &amp;gt; 0. &lt;BR /&gt;
So I dont know why this is happening. Here is a screen shot of the email I receive showing (1) event !!??!? why?&lt;BR /&gt;
Thanks&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2935i4A963A7ACE58CC1E/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 15:54:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296326#M5368</guid>
      <dc:creator>maximusdm</dc:creator>
      <dc:date>2017-05-16T15:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why my alerts are sending email if the search result is zero?</title>
      <link>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296327#M5369</link>
      <description>&lt;P&gt;Try to update the alert to show the events inline and/or csv attachment in the email (select appropriate checkboxes in 'Alert Action' dialog). This way you'd see what Splunk is seeing to trigger alert.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 16:08:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296327#M5369</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-16T16:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why my alerts are sending email if the search result is zero?</title>
      <link>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296328#M5370</link>
      <description>&lt;P&gt;oh I see...if you look at my query it returns the results into a variable called "Occurences" . So even though results returned me ZERO, this option is counting that as a 1 event. Really? that is strange.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 16:39:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296328#M5370</guid>
      <dc:creator>maximusdm</dc:creator>
      <dc:date>2017-05-16T16:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why my alerts are sending email if the search result is zero?</title>
      <link>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296329#M5371</link>
      <description>&lt;P&gt;I didn't look at that. The stats count would give you a result with value of count as 0 if there are no rows. What you should do it to add a where clause in the query itself (e.g. &lt;CODE&gt;..| where Occurrences&amp;gt;0&lt;/CODE&gt; ) to check for count and then change the alert condition to trigger 'when number of events are greater than 0'.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 16:50:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296329#M5371</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-16T16:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why my alerts are sending email if the search result is zero?</title>
      <link>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296330#M5372</link>
      <description>&lt;P&gt;As far as your base search is returning events &lt;CODE&gt;stats count&lt;/CODE&gt; will give default result as 0. Which implies that your alert will always be fired is the &lt;STRONG&gt;Trigger Conditions&lt;/STRONG&gt; is &lt;STRONG&gt;Number of Results&amp;gt;0&lt;/STRONG&gt;. As @somesoni2 mentioned, you either need to add final pipe as&lt;CODE&gt;| search Occurences&amp;gt;0&lt;/CODE&gt; to your alert search or else change your Alert &lt;STRONG&gt;Trigger conditions&lt;/STRONG&gt; to &lt;STRONG&gt;Custom&lt;/STRONG&gt; instead of &lt;CODE&gt;Number of Results&lt;/CODE&gt; and then set the Custom alert condition as &lt;CODE&gt;| search Occurences&amp;gt;0&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 17:08:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296330#M5372</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-05-16T17:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why my alerts are sending email if the search result is zero?</title>
      <link>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296331#M5373</link>
      <description>&lt;P&gt;If you wish to show the trigger condition in your alert email, I would go with @niketnilay's suggestion of using custom trigger condition.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 17:12:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296331#M5373</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-16T17:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why my alerts are sending email if the search result is zero?</title>
      <link>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296332#M5374</link>
      <description>&lt;P&gt;yeah that is what I did: search Occurences &amp;gt; xx&lt;BR /&gt;
but by following your suggestion somesoni2 it pointed me out to the answer. &lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 21:59:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296332#M5374</guid>
      <dc:creator>maximusdm</dc:creator>
      <dc:date>2017-05-16T21:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why my alerts are sending email if the search result is zero?</title>
      <link>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296333#M5375</link>
      <description>&lt;P&gt;Since your question is resolved, please accept somesoni2's comment/answer that led to the resolution.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 02:09:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Why-my-alerts-are-sending-email-if-the-search-result-is-zero/m-p/296333#M5375</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-17T02:09:03Z</dc:date>
    </item>
  </channel>
</rss>

