<?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: Stats -- Alert When Count Exceeds Threshold in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106496#M27685</link>
    <description>&lt;P&gt;Thanks!  Looks like this will work as intended.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jul 2013 14:23:52 GMT</pubDate>
    <dc:creator>vragosta</dc:creator>
    <dc:date>2013-07-25T14:23:52Z</dc:date>
    <item>
      <title>Stats -- Alert When Count Exceeds Threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106491#M27680</link>
      <description>&lt;P&gt;I'm sure this is easy to do, but I'm a bit stumped.  Say I have a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;http_status="500" | stats count by client_address, url, server_name, http_status_description, http_method, http_version, user_agent, referrer
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to generate an alert if the aggregate count is greater than a specified threshold, like 100, but cannot figure out how to do this...&lt;/P&gt;

&lt;P&gt;Any help is appreciated.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 13:49:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106491#M27680</guid>
      <dc:creator>vragosta</dc:creator>
      <dc:date>2013-07-25T13:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Stats -- Alert When Count Exceeds Threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106492#M27681</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
i would say like:&lt;BR /&gt;
http_status="500" | stats count(http_status) as Error_Count by  url|table  server_name,client_address,url,http_status_description, http_method, http_version, user_agent, referrer,Error_Count|where Error_Count &amp;gt; 100&lt;/P&gt;

&lt;P&gt;You can also get rid of some fields which are not really required, to keep the result table clean.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:26:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106492#M27681</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2020-09-28T14:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Stats -- Alert When Count Exceeds Threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106493#M27682</link>
      <description>&lt;P&gt;Just add a where clause at the end like:&lt;/P&gt;

&lt;P&gt;| where count &amp;gt; 100&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 13:57:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106493#M27682</guid>
      <dc:creator>jtrucks</dc:creator>
      <dc:date>2013-07-25T13:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Stats -- Alert When Count Exceeds Threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106494#M27683</link>
      <description>&lt;P&gt;Actually, neither of these will work.  I don't want to know where a single aggregate sum exceeds 100.  I want to know if the sum total of all of the aggregate sums exceeds 100.  For example, I may have something like this:&lt;/P&gt;

&lt;P&gt;client_address  url     server        count&lt;BR /&gt;
10.0.0.1        /stuff  /myserver.com 50&lt;BR /&gt;
10.0.0.2        /stuff2 /myserver.com 51&lt;/P&gt;

&lt;P&gt;I want the above result set to generate an alert because 50+51 &amp;gt; 100.  If I simply check where count &amp;gt; 100, then any one result would need to have a count of 100 or more for the alert to be generated.&lt;/P&gt;

&lt;P&gt;Hope this makes sense.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 14:03:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106494#M27683</guid>
      <dc:creator>vragosta</dc:creator>
      <dc:date>2013-07-25T14:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Stats -- Alert When Count Exceeds Threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106495#M27684</link>
      <description>&lt;P&gt;Based on the comment under jtrucks answer:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;http_status="500" |eventstats count as TOTAL_COUNT| stats latest(TOTAL_COUNT) as TC count by client_address, url, server_name, http_status_description, http_method, http_version, user_agent, referrer | where TC &amp;gt; 100&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Ref:&lt;BR /&gt;
&lt;CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/Eventstats" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/Eventstats&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 14:18:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106495#M27684</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-07-25T14:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Stats -- Alert When Count Exceeds Threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106496#M27685</link>
      <description>&lt;P&gt;Thanks!  Looks like this will work as intended.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 14:23:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106496#M27685</guid>
      <dc:creator>vragosta</dc:creator>
      <dc:date>2013-07-25T14:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Stats -- Alert When Count Exceeds Threshold</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106497#M27686</link>
      <description>&lt;P&gt;For the below requirement i would do stats count only, But will not be able to show other details. I would do a join to just show the count.&lt;/P&gt;

&lt;P&gt;http_status="500" | stats count by  url|join host[http_status="500" | stats count(http_status) as Error_Count]|table  server_name,client_address,url,http_status_description, http_method, http_version, user_agent, referrer,count,Total_Error_Count|where Total_Error_Count &amp;gt; 100&lt;/P&gt;

&lt;P&gt;this will show you Total_Error_count same for each of the urls/ips.&lt;/P&gt;

&lt;P&gt;Hope this gives you a hint, but it's not the correct condition for alert to see.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-Alert-When-Count-Exceeds-Threshold/m-p/106497#M27686</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2020-09-28T14:26:02Z</dc:date>
    </item>
  </channel>
</rss>

