<?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 How do you plot a table of error status codes where there are percentages in the logs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-plot-a-table-of-error-status-codes-where-there-are/m-p/395753#M114902</link>
    <description>&lt;P&gt;The below query gives the count of  each status code 302, 404, 500 etc , Can you please suggest how should I get the percentage of each error code in the logs.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test1 source="/var/log/*ui*"requestOrigin=external (stack_name="*prod*" OR NMG_Stack_Name="*prod*") (requestUrl="*/p/*" OR  requestUrl="*/c*") statusCode!=200 NOT userAgent="*HealthChecker*" | eval rt=responseTime| rex field=requestUrl "((?\/c\/|^\/$))" | stats count as "Count" by  statusCode
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Actual  Output:&lt;/P&gt;

&lt;P&gt;statusCode |  Count&lt;BR /&gt;
301              |        1&lt;BR /&gt;
302              |    4619&lt;BR /&gt;
404              |    180&lt;/P&gt;

&lt;P&gt;Sample Expected Output:&lt;/P&gt;

&lt;P&gt;statusCode  | Count.       |      %Percentage&lt;BR /&gt;
301                 |     1             |      %2&lt;BR /&gt;
302                 | 4619.         |       %20&lt;BR /&gt;
404                 | 180            |       %5&lt;/P&gt;</description>
    <pubDate>Sat, 17 Nov 2018 05:03:56 GMT</pubDate>
    <dc:creator>saifullakhalid</dc:creator>
    <dc:date>2018-11-17T05:03:56Z</dc:date>
    <item>
      <title>How do you plot a table of error status codes where there are percentages in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-plot-a-table-of-error-status-codes-where-there-are/m-p/395753#M114902</link>
      <description>&lt;P&gt;The below query gives the count of  each status code 302, 404, 500 etc , Can you please suggest how should I get the percentage of each error code in the logs.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test1 source="/var/log/*ui*"requestOrigin=external (stack_name="*prod*" OR NMG_Stack_Name="*prod*") (requestUrl="*/p/*" OR  requestUrl="*/c*") statusCode!=200 NOT userAgent="*HealthChecker*" | eval rt=responseTime| rex field=requestUrl "((?\/c\/|^\/$))" | stats count as "Count" by  statusCode
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Actual  Output:&lt;/P&gt;

&lt;P&gt;statusCode |  Count&lt;BR /&gt;
301              |        1&lt;BR /&gt;
302              |    4619&lt;BR /&gt;
404              |    180&lt;/P&gt;

&lt;P&gt;Sample Expected Output:&lt;/P&gt;

&lt;P&gt;statusCode  | Count.       |      %Percentage&lt;BR /&gt;
301                 |     1             |      %2&lt;BR /&gt;
302                 | 4619.         |       %20&lt;BR /&gt;
404                 | 180            |       %5&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 05:03:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-plot-a-table-of-error-status-codes-where-there-are/m-p/395753#M114902</guid>
      <dc:creator>saifullakhalid</dc:creator>
      <dc:date>2018-11-17T05:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do you plot a table of error status codes where there are percentages in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-plot-a-table-of-error-status-codes-where-there-are/m-p/395754#M114903</link>
      <description>&lt;P&gt;A very easy way to do that is to do &lt;CODE&gt;| top statusCode&lt;/CODE&gt; instead of the stats command.&lt;/P&gt;

&lt;P&gt;Note this by default returns only the top 10 results, you can control that by adding &lt;CODE&gt;limit=N&lt;/CODE&gt; to show the top N results (use 0 to remove the limit). For details see: &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.1/SearchReference/Top"&gt;http://docs.splunk.com/Documentation/Splunk/7.2.1/SearchReference/Top&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 07:41:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-plot-a-table-of-error-status-codes-where-there-are/m-p/395754#M114903</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-11-17T07:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do you plot a table of error status codes where there are percentages in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-plot-a-table-of-error-status-codes-where-there-are/m-p/395755#M114904</link>
      <description>&lt;P&gt;My question was how to get the % percentage&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 03:45:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-plot-a-table-of-error-status-codes-where-there-are/m-p/395755#M114904</guid>
      <dc:creator>saifullakhalid</dc:creator>
      <dc:date>2018-11-19T03:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you plot a table of error status codes where there are percentages in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-plot-a-table-of-error-status-codes-where-there-are/m-p/395756#M114905</link>
      <description>&lt;P&gt;Yes, have you tried the top command? That shows the top items along with count and percentage.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 07:27:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-plot-a-table-of-error-status-codes-where-there-are/m-p/395756#M114905</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-11-19T07:27:34Z</dc:date>
    </item>
  </channel>
</rss>

