<?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: Show percentage of total by buckets in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Show-percentage-of-total-by-buckets/m-p/18912#M2816</link>
    <description>&lt;P&gt;Ah this is so obvious now. Thanks so much!&lt;/P&gt;</description>
    <pubDate>Mon, 04 Feb 2013 21:49:40 GMT</pubDate>
    <dc:creator>cosullivan66</dc:creator>
    <dc:date>2013-02-04T21:49:40Z</dc:date>
    <item>
      <title>Show percentage of total by buckets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-percentage-of-total-by-buckets/m-p/18910#M2814</link>
      <description>&lt;P&gt;I'm evaluating a variable called lengthofpayload. I want to separate it into 10 buckets: 0-1000, 1000-2000, etc. Each bucket has a number of events in it, and I want to find the percent of the total events found in that time window each bucket holds. For example, if I wanted to find the number of events and how their payload lengths are distributed in the last 24 hours, it'd look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;6,000 events found  
lengthofpayload             percentage  
0-1000 16%  
1000-2000                   40%  
2000-3000                   20%
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I found this link to something similar, but I don't want a timechart in the end: &lt;A href="http://splunk-base.splunk.com/answers/27590/charting-percentage-of-a-total-over-time"&gt;http://splunk-base.splunk.com/answers/27590/charting-percentage-of-a-total-over-time&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This is the code I'm using and I think it's close but it doesn't work. It prints nothing out for the first(percentage) variable.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="dbmon:kv" |  
search EVENTTYPE="ScreenSharingEvent" |   
eval lengthofpayload=len(PAYLOAD) |  
bucket lengthofpayload bins=10 |  
eventstats count as total by length of payload |  
stats count first(total) as total by lengthofpayload |  
eval percent=(count/total)*100 |  
chart first(percent) by lengthofpayload  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks in advance for help/suggestions!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 19:12:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-percentage-of-total-by-buckets/m-p/18910#M2814</guid>
      <dc:creator>cosullivan66</dc:creator>
      <dc:date>2013-02-04T19:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Show percentage of total by buckets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-percentage-of-total-by-buckets/m-p/18911#M2815</link>
      <description>&lt;P&gt;You can use | top: it will give you the distribution # and % of results grouped by the value of a field. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="dbmon:kv" 
| search EVENTTYPE="ScreenSharingEvent"
| eval lengthofpayload=len(PAYLOAD)
| bucket lengthofpayload bins=10
| top lengthofpayload 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Feb 2013 21:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-percentage-of-total-by-buckets/m-p/18911#M2815</guid>
      <dc:creator>Paolo_Prigione</dc:creator>
      <dc:date>2013-02-04T21:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Show percentage of total by buckets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-percentage-of-total-by-buckets/m-p/18912#M2816</link>
      <description>&lt;P&gt;Ah this is so obvious now. Thanks so much!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 21:49:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-percentage-of-total-by-buckets/m-p/18912#M2816</guid>
      <dc:creator>cosullivan66</dc:creator>
      <dc:date>2013-02-04T21:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Show percentage of total by buckets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-percentage-of-total-by-buckets/m-p/18913#M2817</link>
      <description>&lt;P&gt;I'd like it to display % without #. Do you know how to delete the # column?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 21:52:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-percentage-of-total-by-buckets/m-p/18913#M2817</guid>
      <dc:creator>cosullivan66</dc:creator>
      <dc:date>2013-02-04T21:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Show percentage of total by buckets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-percentage-of-total-by-buckets/m-p/18914#M2818</link>
      <description>&lt;P&gt;| top showcount=false lengthofpayload&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 21:55:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-percentage-of-total-by-buckets/m-p/18914#M2818</guid>
      <dc:creator>Paolo_Prigione</dc:creator>
      <dc:date>2013-02-04T21:55:00Z</dc:date>
    </item>
  </channel>
</rss>

