<?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: Help with Stats command and total count of errors in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Help-with-Stats-command-and-total-count-of-errors/m-p/542587#M5169</link>
    <description>&lt;LI-CODE lang="markup"&gt;index=myindex_prodsourcetype=ssl_access_combined requested_content="/my-app/*" status=50* 
| eventstats count by status
| where count &amp;gt; 50&lt;/LI-CODE&gt;&lt;P&gt;However, this counts 500 and 501 and 502 etc. separately. Is this what you want? If not, and given that you are already filtering on status=50*, just use eventstats count&lt;/P&gt;</description>
    <pubDate>Fri, 05 Mar 2021 15:23:12 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-03-05T15:23:12Z</dc:date>
    <item>
      <title>Help with Stats command and total count of errors</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Help-with-Stats-command-and-total-count-of-errors/m-p/542566#M5167</link>
      <description>&lt;P&gt;Hi, I am working an setting up a alert where I need to count if there have been more than 50 count of errors in last 30 minutes.&lt;/P&gt;&lt;P&gt;And if there is then I need to send the alert with those pages and count. Something like below&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;requested_content&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Status&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;/my-app/1.html&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;500&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;/my-app/2.html&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;500&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;60&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the alert should only trigger if the sum of these counts &amp;gt; 50 like above. I have written a query but it only gives the count and not the pages which are throwing the error. I want to see the pages too&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=myindex_prodsourcetype=ssl_access_combined requested_content="/my-app/*" status=50* 
| stats count by status
| where count &amp;gt; 50&lt;/LI-CODE&gt;&lt;P&gt;Can someone able to advice on this how to achieve this? I want the alert to be triggered and it should output the tabular format with pages and it's count with total count &amp;gt; 50&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 14:59:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Help-with-Stats-command-and-total-count-of-errors/m-p/542566#M5167</guid>
      <dc:creator>shashank_24</dc:creator>
      <dc:date>2021-03-05T14:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Stats command and total count of errors</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Help-with-Stats-command-and-total-count-of-errors/m-p/542585#M5168</link>
      <description>&lt;P&gt;The stats command discards fields it doesn't use so to make them available later in the query they must be mentioned in stats.&amp;nbsp; Try this query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="requested_content	Status
/my-app/1.html	500
/my-app/2.html	500" | multikv forceheader=1
```Above just defines test data```
| stats count by requested_content,Status
```Calculate the total count and add it as a field to each result```
| eventstats sum(count) as total
```Show the results only when the total exceeds the limit```
| where total&amp;gt;50
```Don't show the total field```
| fields - total&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 05 Mar 2021 15:20:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Help-with-Stats-command-and-total-count-of-errors/m-p/542585#M5168</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-03-05T15:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Stats command and total count of errors</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Help-with-Stats-command-and-total-count-of-errors/m-p/542587#M5169</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=myindex_prodsourcetype=ssl_access_combined requested_content="/my-app/*" status=50* 
| eventstats count by status
| where count &amp;gt; 50&lt;/LI-CODE&gt;&lt;P&gt;However, this counts 500 and 501 and 502 etc. separately. Is this what you want? If not, and given that you are already filtering on status=50*, just use eventstats count&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 15:23:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Help-with-Stats-command-and-total-count-of-errors/m-p/542587#M5169</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-05T15:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Stats command and total count of errors</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Help-with-Stats-command-and-total-count-of-errors/m-p/542588#M5170</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;. That almost solved my purpose. Just one more thing - So right now my alert trigger condition is like this - I should have mentioned in the question Sorry.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where (status=500 AND count &amp;gt; 50) OR (status=503 AND count &amp;gt; 30) OR (status=502 AND count &amp;gt; 30)&lt;/LI-CODE&gt;&lt;P&gt;So is it possible to count the total individually by status and then trigger the alert?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 15:29:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Help-with-Stats-command-and-total-count-of-errors/m-p/542588#M5170</guid>
      <dc:creator>shashank_24</dc:creator>
      <dc:date>2021-03-05T15:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Stats command and total count of errors</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Help-with-Stats-command-and-total-count-of-errors/m-p/542615#M5177</link>
      <description>&lt;P&gt;Based on the new requirements, you just need the &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command from my answer.&amp;nbsp; Do be careful of cases in field names, though.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 17:50:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Help-with-Stats-command-and-total-count-of-errors/m-p/542615#M5177</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-03-05T17:50:57Z</dc:date>
    </item>
  </channel>
</rss>

