<?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: Timechart percent count of http status code in Security</title>
    <link>https://community.splunk.com/t5/Security/Timechart-percent-count-of-http-status-code/m-p/532271#M11997</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228395"&gt;@orca&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a number of ways to do this, but it will naturally involve searching all the data to get the totals to then work out the percentage. This will given you a single total percentage for all errors, as well as the individual error counts&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=cgn
| timechart count by status
| addtotals
| addtotals fieldname=Errors 5*
| eval ErrorRate=round(Errors/Total*100,2)
| fields _time 5* ErrorRate&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and you can then plot the ErrorRate field as a second Y-axis, with its own scale. This gives you best of both worlds in that you can quantify the volume of requests as you have the error counts.&lt;/P&gt;&lt;P&gt;Alternatively if you just want the rate of errors without counts, you can do this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=cgn
| timechart count by status
| addtotals
| foreach 5* [ addtotals fieldname=tmp_&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt; 5&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt; | eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=round('tmp_&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;'/Total*100,2) ]
| fields _time 5*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If you also wanted Total on the right Y-axis, then add Total to the final fields statement and edit the graph accordingly.&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Dec 2020 02:48:50 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2020-12-08T02:48:50Z</dc:date>
    <item>
      <title>Timechart percent count of http status code</title>
      <link>https://community.splunk.com/t5/Security/Timechart-percent-count-of-http-status-code/m-p/532268#M11996</link>
      <description>&lt;P&gt;I have a requirement where I want to show the timechart of 5xx errors percentage by total request.&lt;/P&gt;&lt;P&gt;currently I have&lt;/P&gt;&lt;P&gt;index=cgn http_status=5*|timechart count&amp;nbsp;&lt;/P&gt;&lt;P&gt;this gives me timechart as&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-12-07 at 5.54.20 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12213iF34C30EF7DE74BE8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-12-07 at 5.54.20 PM.png" alt="Screen Shot 2020-12-07 at 5.54.20 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but this does not gives me the real picture as how the backend node doing. so I need to change the chart to percentage of 5xx errors over total request so that I can find out how big the issue is.&lt;/P&gt;&lt;P&gt;Any help?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 01:58:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Timechart-percent-count-of-http-status-code/m-p/532268#M11996</guid>
      <dc:creator>orca</dc:creator>
      <dc:date>2020-12-08T01:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart percent count of http status code</title>
      <link>https://community.splunk.com/t5/Security/Timechart-percent-count-of-http-status-code/m-p/532271#M11997</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228395"&gt;@orca&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a number of ways to do this, but it will naturally involve searching all the data to get the totals to then work out the percentage. This will given you a single total percentage for all errors, as well as the individual error counts&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=cgn
| timechart count by status
| addtotals
| addtotals fieldname=Errors 5*
| eval ErrorRate=round(Errors/Total*100,2)
| fields _time 5* ErrorRate&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and you can then plot the ErrorRate field as a second Y-axis, with its own scale. This gives you best of both worlds in that you can quantify the volume of requests as you have the error counts.&lt;/P&gt;&lt;P&gt;Alternatively if you just want the rate of errors without counts, you can do this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=cgn
| timechart count by status
| addtotals
| foreach 5* [ addtotals fieldname=tmp_&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt; 5&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt; | eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=round('tmp_&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;'/Total*100,2) ]
| fields _time 5*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If you also wanted Total on the right Y-axis, then add Total to the final fields statement and edit the graph accordingly.&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 02:48:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Timechart-percent-count-of-http-status-code/m-p/532271#M11997</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-12-08T02:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart percent count of http status code</title>
      <link>https://community.splunk.com/t5/Security/Timechart-percent-count-of-http-status-code/m-p/532390#M11998</link>
      <description>&lt;P&gt;Thankyou! This is beautiful and neat.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only I have added limit=100 in timechart as I have huge volume of data and 5xx were going as OTHER slice.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 20:38:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Timechart-percent-count-of-http-status-code/m-p/532390#M11998</guid>
      <dc:creator>orca</dc:creator>
      <dc:date>2020-12-08T20:38:33Z</dc:date>
    </item>
  </channel>
</rss>

