<?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: BIN - incorrect  buckets in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/694992#M236353</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/265845"&gt;@kp_pl&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;as you can run at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SCS/current/SearchReference/BinCommandOverview" target="_blank"&gt;https://docs.splunk.com/Documentation/SCS/current/SearchReference/BinCommandOverview&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The SPL2 bin command puts continuous numerical values into discrete sets, or bins, by adjusting the value of &amp;lt;field&amp;gt; so that all of the items in a particular set have the same value.&lt;/LI-CODE&gt;&lt;P&gt;but the option to give the groups is span and not bin, bin gives the number of groups.&lt;/P&gt;&lt;P&gt;so please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your-search&amp;gt;
| bin span=10 TIMETAKEN 
| stats count by TIMETAKEN&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;in other words, you could use&lt;/P&gt;</description>
    <pubDate>Thu, 01 Aug 2024 14:56:48 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-08-01T14:56:48Z</dc:date>
    <item>
      <title>BIN - incorrect  buckets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/694978#M236348</link>
      <description>&lt;P&gt;In my case there is an index with field OP which has a duration TT . Of course there are a lot of records with different OPs and diffent TTs&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| stats perec25(TT) as Q1, median(TT) as Q2MEDIAN, perc75(TT) as Q3, perc98(TT) as P98 by OP&lt;/LI-CODE&gt;
&lt;P&gt;Here is the way I count quartiles and 98percentile of my set. The result is four values between 2sek.(Q1 ) and 40sek.(P98) for every OP.&lt;BR /&gt;Last time &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt; mestioned about command BIN. I like it! I wondered about creating 10 bins instead ( kind of every10 percentile).&lt;BR /&gt;I did somethink like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| bin TIMETAKEN bins=10 |stats count(TIMETAKEN) by TIMETAKEN&lt;/LI-CODE&gt;
&lt;P&gt;and expected to see 10 bins but the result was :&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;TIMETAKEN count(TIMETAKEN)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;0-10 6393&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;10-20 389&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;20-30 15&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;40-50 2&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;so no 10 bins but only 4 &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; What am I doing wrong ?&lt;BR /&gt;&lt;BR /&gt;And how to create 10 bins for each OP ? Something like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| bin TIMETAKEN bins=10 |stats count(TIMETAKEN) by OP&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 14:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/694978#M236348</guid>
      <dc:creator>kp_pl</dc:creator>
      <dc:date>2024-08-01T14:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: BIN - incorrect  buckets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/694992#M236353</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/265845"&gt;@kp_pl&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;as you can run at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SCS/current/SearchReference/BinCommandOverview" target="_blank"&gt;https://docs.splunk.com/Documentation/SCS/current/SearchReference/BinCommandOverview&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The SPL2 bin command puts continuous numerical values into discrete sets, or bins, by adjusting the value of &amp;lt;field&amp;gt; so that all of the items in a particular set have the same value.&lt;/LI-CODE&gt;&lt;P&gt;but the option to give the groups is span and not bin, bin gives the number of groups.&lt;/P&gt;&lt;P&gt;so please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your-search&amp;gt;
| bin span=10 TIMETAKEN 
| stats count by TIMETAKEN&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;in other words, you could use&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 14:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/694992#M236353</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-08-01T14:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: BIN - incorrect  buckets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/695018#M236358</link>
      <description>&lt;P&gt;You checked the SPL2 bin command, not the SPL one.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Bin" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Bin&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 18:22:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/695018#M236358</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-01T18:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: BIN - incorrect  buckets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/695025#M236359</link>
      <description>&lt;P&gt;Indeed the bin command behaves... interestingly.&lt;/P&gt;&lt;P&gt;A run-anywhere example&lt;/P&gt;&lt;PRE&gt;| makeresults count=999&lt;BR /&gt;| streamstats count&lt;BR /&gt;| eval count=count+1&lt;BR /&gt;| map maxsearches=10000 search="| makeresults count=10000&lt;BR /&gt;| eval r=random() % 10000&lt;BR /&gt;| bin bins=$count$ r &lt;BR /&gt;| stats count by r|stats count as bins |eval count=$count$"&lt;/PRE&gt;&lt;P&gt;It shows that it splits into either 1, 10, 100 or 1000 buckets.&lt;/P&gt;&lt;P&gt;That's... strange.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 20:24:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/695025#M236359</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-01T20:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: BIN - incorrect  buckets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/695031#M236363</link>
      <description>&lt;P&gt;Does not matter SPAN or BIN equal 10&amp;nbsp; it creates 4 or 5 buckets &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp; I even gave bin=20&amp;nbsp; but it returned the same result. I need to agree with &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp; behaviour of&amp;nbsp; bin is sort of interesting .&amp;nbsp;&lt;BR /&gt;But in fact documentation says :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;bins &lt;STRONG&gt;Syntax:&lt;/STRONG&gt; bins=&amp;lt;int&amp;gt; &lt;STRONG&gt;Description:&lt;/STRONG&gt; Sets &lt;U&gt;the maximum &lt;/U&gt;number of bins to discretize into.&lt;/P&gt;&lt;P&gt;So the Splunk decides how many bin it creates not me &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 01 Aug 2024 21:27:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/695031#M236363</guid>
      <dc:creator>kp_pl</dc:creator>
      <dc:date>2024-08-01T21:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: BIN - incorrect  buckets</title>
      <link>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/695078#M236378</link>
      <description>&lt;P&gt;Yes, it seems Splunk has some more internal rules on how many buckets it creates so I think a doc feedback is called for.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 11:30:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/BIN-incorrect-buckets/m-p/695078#M236378</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-02T11:30:54Z</dc:date>
    </item>
  </channel>
</rss>

