<?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: top command (or count &amp; percent of values) off stats command (summary) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/top-command-or-count-percent-of-values-off-stats-command-summary/m-p/127493#M34601</link>
    <description>&lt;P&gt;I am assuming after the stats command, the events are like below&lt;/P&gt;

&lt;P&gt;brower     count&lt;BR /&gt;
IE          xx&lt;BR /&gt;
Chrome      yy&lt;BR /&gt;
......&lt;/P&gt;

&lt;P&gt;Then you can do something like this after stats.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...your stats query...| eventstats sum(count) as Total | eval percent=round(count*100/Total,1)."%" | sort -count | streamstats count as sno | where sno &amp;lt; NoOfTopValuesYouWantToSee | fields - Total, sno
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 10 Apr 2014 17:45:28 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-04-10T17:45:28Z</dc:date>
    <item>
      <title>top command (or count &amp; percent of values) off stats command (summary)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/top-command-or-count-percent-of-values-off-stats-command-summary/m-p/127491#M34599</link>
      <description>&lt;P&gt;Using Splunk 5.0.8 SH right now, upgrade to 6 not until June.&lt;/P&gt;

&lt;P&gt;I have a dashboard that currently executes 24 searches for a span of 24 hours.  Goal:  Run one search and post-process the dash panels as everything has one filter search and can be summarized into 7 different fields and value combos.  That one search would be saved and accelerated and end in a stats command.&lt;/P&gt;

&lt;P&gt;ISSUE:  most of my panels are top commands.  since I plan to both timechart and top the results, I would be bucketing _time.  How can I use the top command to take into account the values from the count field?  Example of issue:  If I have one stats event with browser=IE and a count of 10 and another stats event with browser=Chrome with a count of 5, a &lt;EM&gt;| top browser&lt;/EM&gt; will show me:&lt;BR /&gt;
  browser     count     percent&lt;BR /&gt;
  Chrome      1         50%&lt;BR /&gt;
  IE          1         50%&lt;/P&gt;

&lt;P&gt;This is not what I need.  I need both the sum of count for each value rather than the top command's count of the events.  I also need the percent so just doing a &lt;EM&gt;sum(count) by browser | sort browser | head 10&lt;/EM&gt; doesn't do it.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2014 16:41:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/top-command-or-count-percent-of-values-off-stats-command-summary/m-p/127491#M34599</guid>
      <dc:creator>jluste</dc:creator>
      <dc:date>2014-04-10T16:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: top command (or count &amp; percent of values) off stats command (summary)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/top-command-or-count-percent-of-values-off-stats-command-summary/m-p/127492#M34600</link>
      <description>&lt;P&gt;So I found my own answer after more Splunk Answers digging:  Found &lt;A href="http://answers.splunk.com/answers/6157/percent-of-total"&gt;here&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Basically what I need is &lt;EM&gt;this&lt;/EM&gt; added to get a "top-like result" for summarized data (either from a summary index or post processing from a stats commanded result:&lt;/P&gt;

&lt;P&gt;| stats sum(count) as count by browser | eventstats sum(count) as Total | eval percent = round((count/Total)*100,2) . "%" | fields - Total&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2014 17:38:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/top-command-or-count-percent-of-values-off-stats-command-summary/m-p/127492#M34600</guid>
      <dc:creator>jluste</dc:creator>
      <dc:date>2014-04-10T17:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: top command (or count &amp; percent of values) off stats command (summary)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/top-command-or-count-percent-of-values-off-stats-command-summary/m-p/127493#M34601</link>
      <description>&lt;P&gt;I am assuming after the stats command, the events are like below&lt;/P&gt;

&lt;P&gt;brower     count&lt;BR /&gt;
IE          xx&lt;BR /&gt;
Chrome      yy&lt;BR /&gt;
......&lt;/P&gt;

&lt;P&gt;Then you can do something like this after stats.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...your stats query...| eventstats sum(count) as Total | eval percent=round(count*100/Total,1)."%" | sort -count | streamstats count as sno | where sno &amp;lt; NoOfTopValuesYouWantToSee | fields - Total, sno
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Apr 2014 17:45:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/top-command-or-count-percent-of-values-off-stats-command-summary/m-p/127493#M34601</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-04-10T17:45:28Z</dc:date>
    </item>
  </channel>
</rss>

