<?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 to specify fixed size bucket/bin with stats? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290782#M87866</link>
    <description>&lt;P&gt;when I create a stats and try to specify bins by following:&lt;BR /&gt;
&lt;STRONG&gt;bucket time_taken bins=10 | stats count(_time) as size_a by time_taken&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I get different bin sizes when I change the time span from last 7 days to Year to Date.&lt;BR /&gt;
I am looking for fixed bin sizes of 0-100,100-200,200-300 and so on, irrespective of the data points generated by time.&lt;/P&gt;

&lt;P&gt;How can I achieve this?&lt;/P&gt;

&lt;P&gt;Any help is appreciated.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 14:43:14 GMT</pubDate>
    <dc:creator>howardroark</dc:creator>
    <dc:date>2020-09-29T14:43:14Z</dc:date>
    <item>
      <title>How to specify fixed size bucket/bin with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290782#M87866</link>
      <description>&lt;P&gt;when I create a stats and try to specify bins by following:&lt;BR /&gt;
&lt;STRONG&gt;bucket time_taken bins=10 | stats count(_time) as size_a by time_taken&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I get different bin sizes when I change the time span from last 7 days to Year to Date.&lt;BR /&gt;
I am looking for fixed bin sizes of 0-100,100-200,200-300 and so on, irrespective of the data points generated by time.&lt;/P&gt;

&lt;P&gt;How can I achieve this?&lt;/P&gt;

&lt;P&gt;Any help is appreciated.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:43:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290782#M87866</guid>
      <dc:creator>howardroark</dc:creator>
      <dc:date>2020-09-29T14:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify fixed size bucket/bin with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290783#M87867</link>
      <description>&lt;P&gt;Use &lt;CODE&gt;span&lt;/CODE&gt; instead of &lt;CODE&gt;bins&lt;/CODE&gt; option with bucket command, like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| bucket span=100 time_taken | stats count as size_a by time_taken | sort num(time_taken)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jul 2017 15:26:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290783#M87867</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-06T15:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify fixed size bucket/bin with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290784#M87868</link>
      <description>&lt;P&gt;Does bucket sometimes start from odd numbers, like 53-152?  I seem to recall having had to add a "zero" record before and delete it after in order to make the numbers be even.  Might have been when the range went to negative numbers as well.  &lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 15:35:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290784#M87868</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-06T15:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify fixed size bucket/bin with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290785#M87869</link>
      <description>&lt;P&gt;@somesoni2 thanks that helped. Though as i change the time the x-axis labels disappear. I dont know how to display permanently&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 15:49:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290785#M87869</guid>
      <dc:creator>howardroark</dc:creator>
      <dc:date>2017-07-06T15:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify fixed size bucket/bin with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290786#M87870</link>
      <description>&lt;P&gt;The x-axis labels will be visible based on number of points being shown  (works good if number of points are under 100 or 74 from what I recall). so check how many rows your stats is giving back, may be adjust your span accordingly.&lt;/P&gt;

&lt;P&gt;@Daljeanis, I guess the bucketing works good if they are standard spans like 10, 5, 20, 100. I tested with this runanywhere sample and it seems to be consistent with "good" spans.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1000 | streamstats count as sno | where sno&amp;gt;3| bucket span=10 sno | stats count by sno | sort num(sno)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jul 2017 16:01:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290786#M87870</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-06T16:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify fixed size bucket/bin with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290787#M87871</link>
      <description>&lt;P&gt;@somesoni2 can we not limit the axis range 0-100 to the last data point 1000-1100. Just show end buckets and skip the rest of them to make it look sensible&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 16:59:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290787#M87871</guid>
      <dc:creator>howardroark</dc:creator>
      <dc:date>2017-07-06T16:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify fixed size bucket/bin with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290788#M87872</link>
      <description>&lt;P&gt;You can specify how many records you want to keep by either specifying limit in your sort command OR using head command, like this (for sort without by clause):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;current command including stats | sort 100 num(sno)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;current command including stats | sort num(sno) | head 100
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jul 2017 18:28:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290788#M87872</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-06T18:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify fixed size bucket/bin with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290789#M87873</link>
      <description>&lt;P&gt;This would provide me with top 100 values. I am looking for all the values but custom x-axis label to atleast get some context of presented data. Like getting first and last bin on the x-axis label&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 18:51:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290789#M87873</guid>
      <dc:creator>howardroark</dc:creator>
      <dc:date>2017-07-06T18:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify fixed size bucket/bin with stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290790#M87874</link>
      <description>&lt;P&gt;AFAIK, no such option exists. &lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 18:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-specify-fixed-size-bucket-bin-with-stats/m-p/290790#M87874</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-06T18:55:54Z</dc:date>
    </item>
  </channel>
</rss>

