<?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 trigger count range in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706579#M21062</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/274636"&gt;@jwv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I've tried this a few ways with no success, I tried to just append the where condition on the end of my query so it looks something like this&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my-index" | search "http 404" | stats count | where count =&amp;gt; 250 AND count &amp;lt;= 100&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;but this still just returns the number of matching events and I run into the same problem trying to set up the alert.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That the search "just returns the number of matching events" is to be expected since that is all it is told to do.&amp;nbsp; The where command should cause the search to return a result only if that result is a number between 250 and 500; otherwise it should say "No results found".&amp;nbsp; That is what will trigger the alert - if there is a result (Number of events &amp;gt; 0) it's because the search criteria were met.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2024 20:08:43 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2024-12-11T20:08:43Z</dc:date>
    <item>
      <title>Custom alert trigger count range</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706057#M20971</link>
      <description>&lt;P&gt;I want my alert to trigger when the result count is between 250 and 500, trying to use the custom trigger condition in the alert setup with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search count =&amp;gt; 250 AND search count &amp;lt;=500&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;but this is not working as expected. Even trying to to use the custom trigger condition for one condition like search count =&amp;gt; 250 is not working. What is the right way to do this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 20:22:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706057#M20971</guid>
      <dc:creator>jwv</dc:creator>
      <dc:date>2024-12-05T20:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Custom alert trigger count range</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706059#M20973</link>
      <description>&lt;P&gt;I've found the custom triggers to be unreliable at best.&amp;nbsp; What works better is to put the alert condition in the search query and have the alert trigger when the number of results is not zero.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 20:39:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706059#M20973</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-12-05T20:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Custom alert trigger count range</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706369#M21036</link>
      <description>&lt;P&gt;Thank you for the tip! Do you have any suggestions on how to format this query? I'm not sure the best way to do this when I need the alert to fire based of number of results.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 16:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706369#M21036</guid>
      <dc:creator>jwv</dc:creator>
      <dc:date>2024-12-09T16:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Custom alert trigger count range</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706370#M21037</link>
      <description>&lt;P&gt;Move the trigger condition from the alert to the search.&amp;nbsp; IOW, put this on the end of the query&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where count =&amp;gt; 250 AND count &amp;lt;=500&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Dec 2024 17:04:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706370#M21037</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-12-09T17:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Custom alert trigger count range</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706578#M21061</link>
      <description>&lt;P&gt;I've tried this a few ways with no success, I tried to just append the where condition on the end of my query so it looks something like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my-index" | search "http 404" | stats count | where count =&amp;gt; 250 AND count &amp;lt;= 100&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but this still just returns the number of matching events and I run into the same problem trying to set up the alert.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also tried with eval to output a result like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my-index" | search "http 404" | stats count | eval result=if(count&amp;gt;=250 AND count&amp;lt;=500, 1, 0) | table result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which properly returns 1 or 0 depending on if the number of results are in the range I am looking for, however it is still not alerting properly when the trigger is set to &amp;gt;1.&amp;nbsp; I think the trigger is still running against the number of events which is also being returned (and I like that I can see this) and not the result I set up.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-12-11 at 2.30.54 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/33815i7B43EA4E8E74D004/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-12-11 at 2.30.54 PM.png" alt="Screenshot 2024-12-11 at 2.30.54 PM.png" /&gt;&lt;/span&gt;.&lt;/P&gt;&lt;P&gt;Any other suggestions would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 19:41:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706578#M21061</guid>
      <dc:creator>jwv</dc:creator>
      <dc:date>2024-12-11T19:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Custom alert trigger count range</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706579#M21062</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/274636"&gt;@jwv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I've tried this a few ways with no success, I tried to just append the where condition on the end of my query so it looks something like this&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my-index" | search "http 404" | stats count | where count =&amp;gt; 250 AND count &amp;lt;= 100&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;but this still just returns the number of matching events and I run into the same problem trying to set up the alert.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That the search "just returns the number of matching events" is to be expected since that is all it is told to do.&amp;nbsp; The where command should cause the search to return a result only if that result is a number between 250 and 500; otherwise it should say "No results found".&amp;nbsp; That is what will trigger the alert - if there is a result (Number of events &amp;gt; 0) it's because the search criteria were met.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 20:08:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Custom-alert-trigger-count-range/m-p/706579#M21062</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-12-11T20:08:43Z</dc:date>
    </item>
  </channel>
</rss>

