<?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: Bucketing fields (and events that are floating point values) in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/Bucketing-fields-and-events-that-are-floating-point-values/m-p/56317#M1883</link>
    <description>&lt;P&gt;Oh nuts.  Sorry - I somehow missed that these werent floats, but rather version strings with multiple decimal points.  I'll update my answer&lt;/P&gt;</description>
    <pubDate>Wed, 16 Mar 2011 03:25:50 GMT</pubDate>
    <dc:creator>sideview</dc:creator>
    <dc:date>2011-03-16T03:25:50Z</dc:date>
    <item>
      <title>Bucketing fields (and events that are floating point values)</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Bucketing-fields-and-events-that-are-floating-point-values/m-p/56314#M1880</link>
      <description>&lt;P&gt;So say that I have a field called Version and version can range from 2.6.0 to 4.8.1 per event. What would be the way to bucket, categorize, or group or make Version add in the range of 2.0 to 2.5 and 2.6 to 2.9 then 3.0 to 3.5 then 3.6 to 3.9 and finally 4.0 to 4.8 for eventranges. In effect I need a quantize function. quantize {numerical field} min={value} max= {value} step={value} number of buckets = {value} kinda function?&lt;/P&gt;

&lt;P&gt;Anyone got any ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2011 12:35:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Bucketing-fields-and-events-that-are-floating-point-values/m-p/56314#M1880</guid>
      <dc:creator>ngcgoon</dc:creator>
      <dc:date>2011-03-09T12:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Bucketing fields (and events that are floating point values)</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Bucketing-fields-and-events-that-are-floating-point-values/m-p/56315#M1881</link>
      <description>&lt;P&gt;Quick answers  &lt;/P&gt;

&lt;P&gt;1) you should read up on the &lt;CODE&gt;bucket&lt;/CODE&gt; command  (aka &lt;CODE&gt;bin&lt;/CODE&gt;)&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Bucket" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Bucket&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | bucket Version span=0.5 | stats count by Version
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) you should also read up about the timechart and chart commands, because they also have pretty powerful bucketing abilities when you use split by fields.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | chart avg(someNumericField) over Version span=0.5

&amp;lt;your search&amp;gt; | chart count over someCategoricalField by Version span=0.5

&amp;lt;your search&amp;gt; | timechart count by Version span=0.5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;etc...&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Chart" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Chart&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hopefully that will give you enough to get going.&lt;/P&gt;

&lt;P&gt;UPDATE: &lt;/P&gt;

&lt;P&gt;of course your version strings are not decimals but version strings with more than one decimal point in them. Bucket wont know what to make of these directly.   &lt;/P&gt;

&lt;P&gt;What I would do is  use rex to extract another field that &lt;EM&gt;only&lt;/EM&gt; does the first two segments of the version, then bucket the results by that field.&lt;/P&gt;

&lt;P&gt;Do this to see what I'm talking about: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex field=Version (?&amp;lt;MajorVersion&amp;gt;\d+\.\d+)? 
| bucket MajorVersion span=0.5 | stats count by Version, MajorVersion
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So depending on what you want to do, the final version might be: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex field=Version (?&amp;lt;MajorVersion&amp;gt;\d+\.\d+)? 
| bucket MajorVersion span=0.5
| stats sum(bytes) as total_bytes dc(users) as distinct_users by MajorVersion
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And if you want to preserve the raw values of Version in there,  throw a &lt;CODE&gt;values(Version) as Versions&lt;/CODE&gt; into the stats command.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2011 13:17:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Bucketing-fields-and-events-that-are-floating-point-values/m-p/56315#M1881</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-03-09T13:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Bucketing fields (and events that are floating point values)</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Bucketing-fields-and-events-that-are-floating-point-values/m-p/56316#M1882</link>
      <description>&lt;P&gt;This is not working especially on my Version field. The first search example is returning all of the values and not placing them into bins or buckets.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2011 01:14:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Bucketing-fields-and-events-that-are-floating-point-values/m-p/56316#M1882</guid>
      <dc:creator>ngcgoon</dc:creator>
      <dc:date>2011-03-15T01:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Bucketing fields (and events that are floating point values)</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Bucketing-fields-and-events-that-are-floating-point-values/m-p/56317#M1883</link>
      <description>&lt;P&gt;Oh nuts.  Sorry - I somehow missed that these werent floats, but rather version strings with multiple decimal points.  I'll update my answer&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2011 03:25:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Bucketing-fields-and-events-that-are-floating-point-values/m-p/56317#M1883</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-03-16T03:25:50Z</dc:date>
    </item>
  </channel>
</rss>

