<?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: How to timechart percent values generated by top command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-percent-values-generated-by-top-command/m-p/643802#M223028</link>
    <description>&lt;P&gt;Those pesky quotation marks...&lt;/P&gt;&lt;P&gt;That did the trick! Thank you for your help!&lt;/P&gt;</description>
    <pubDate>Thu, 18 May 2023 15:50:24 GMT</pubDate>
    <dc:creator>beetlegeuse</dc:creator>
    <dc:date>2023-05-18T15:50:24Z</dc:date>
    <item>
      <title>How to timechart percent values generated by top command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-percent-values-generated-by-top-command/m-p/643688#M222985</link>
      <description>&lt;P&gt;I'm using a pretty straightforward query to see how many unique HTTP status codes are thrown from an IIS server during a given time period:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo host=bar sourcetype=iis85
| top sc_status&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The results are as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sc_status	count	         percent
401	        95115	        36.975773
302	        91840	        35.702623
200	        70141	        27.267179
404	          140	         0.054425&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding the percentage values for each of the status codes together equals 100%.&lt;/P&gt;&lt;P&gt;I'd like to run the search across a longer timeframe (24 hours) and visualize on a line chart the percentages for each status code using a five minute aggregation. How can I accomplish this?&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 03:20:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-percent-values-generated-by-top-command/m-p/643688#M222985</guid>
      <dc:creator>beetlegeuse</dc:creator>
      <dc:date>2023-05-18T03:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to timechart percent values generated by top command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-percent-values-generated-by-top-command/m-p/643694#M222989</link>
      <description>&lt;P&gt;It sounds like a job for the &lt;FONT face="courier new,courier"&gt;timechart&lt;/FONT&gt; command.&amp;nbsp; Here's one approach, but there may be others.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo host=bar sourcetype=iis85
```Count events by status over 5-minute aggregations, taking only the top 10 ```
| timechart span=5m limit=10 useother=0 usenull=0 count by sc_status
```Get the total count for each time period ```
| addtotals label="Total" labelfield=Total
```Replace each result with a percentage of Total```
| foreach * [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = round('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'*100/Total, 2)]
```Remove the Total field```
| fields - Total&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 13:56:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-percent-values-generated-by-top-command/m-p/643694#M222989</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-05-18T13:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to timechart percent values generated by top command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-percent-values-generated-by-top-command/m-p/643703#M222991</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;This gets me closer (timechart shows individual status codes...yay!), but adding up the percentage values from each status code for a given five minute period does not equal 100%. And, if I include the "total" field in the output, you'll note that it's consistently showing 100.00 as the value every five minutes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_time	              200	   302     401	   404      Total
2023-05-16 00:00:00	71.94	108.63	144.24	145.32     100.00
2023-05-16 00:05:00	71.94	108.63	144.24	145.32     100.00
2023-05-16 00:10:00	69.69	105.23	139.72	140.77     100.00
2023-05-16 00:15:00	69.93	105.59	140.21	141.26     100.00&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 12:36:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-percent-values-generated-by-top-command/m-p/643703#M222991</guid>
      <dc:creator>beetlegeuse</dc:creator>
      <dc:date>2023-05-18T12:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to timechart percent values generated by top command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-percent-values-generated-by-top-command/m-p/643775#M223020</link>
      <description>&lt;P&gt;I didn't account for field names that are integers.&amp;nbsp; I've updated my answer.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 13:57:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-percent-values-generated-by-top-command/m-p/643775#M223020</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-05-18T13:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to timechart percent values generated by top command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-percent-values-generated-by-top-command/m-p/643802#M223028</link>
      <description>&lt;P&gt;Those pesky quotation marks...&lt;/P&gt;&lt;P&gt;That did the trick! Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 15:50:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-percent-values-generated-by-top-command/m-p/643802#M223028</guid>
      <dc:creator>beetlegeuse</dc:creator>
      <dc:date>2023-05-18T15:50:24Z</dc:date>
    </item>
  </channel>
</rss>

