<?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 does the bucket command create bins? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-does-the-bucket-command-create-bins/m-p/170745#M48879</link>
    <description>&lt;P&gt;The 'bins' option in bucket specifies maximum no of bins that can be created, doesn't imply that search will create two bins only. bucket command is not suitable for your requirements as your time range can be dynamic.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2014 21:46:50 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-02-28T21:46:50Z</dc:date>
    <item>
      <title>How does the bucket command create bins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-does-the-bucket-command-create-bins/m-p/170744#M48878</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;I thought that the bucket command would split events into two bins that cover half the search span if i use 2 bins on _time:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | bucket _time bins=2 | stats count by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Depending on the selected time range bucket will only create 1 bin. This search yields the results I expect:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | addinfo | eval half_span=(info_max_time-info_min_time)/2 | eval cur=if(_time&amp;gt;info_max_time-half_span,1,0) | stats count by cur | sort -cur
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can someone explain how bucket is used properly?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Chris&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2014 21:33:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-does-the-bucket-command-create-bins/m-p/170744#M48878</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2014-02-28T21:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: How does the bucket command create bins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-does-the-bucket-command-create-bins/m-p/170745#M48879</link>
      <description>&lt;P&gt;The 'bins' option in bucket specifies maximum no of bins that can be created, doesn't imply that search will create two bins only. bucket command is not suitable for your requirements as your time range can be dynamic.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2014 21:46:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-does-the-bucket-command-create-bins/m-p/170745#M48879</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-28T21:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: How does the bucket command create bins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-does-the-bucket-command-create-bins/m-p/170746#M48880</link>
      <description>&lt;P&gt;Thank you, reading the documentation would have helped -  well maybe this is useful for someone else.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2014 22:02:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-does-the-bucket-command-create-bins/m-p/170746#M48880</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2014-02-28T22:02:34Z</dc:date>
    </item>
  </channel>
</rss>

