<?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 to show empty bins on my chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229437#M67944</link>
    <description>&lt;P&gt;This is even worse without the bin command as new bins are created for each value:&lt;BR /&gt;
See &lt;A href="http://postimg.org/image/ilo0d7wi3/"&gt;http://postimg.org/image/ilo0d7wi3/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Nov 2015 09:43:36 GMT</pubDate>
    <dc:creator>pduflot</dc:creator>
    <dc:date>2015-11-20T09:43:36Z</dc:date>
    <item>
      <title>How to show empty bins on my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229430#M67937</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have my data between -1 and 1 and I want to show a distribution graph. I would like that the X axis is always 20 bins of size 0.1.&lt;BR /&gt;
I tried to used the bin command, but whenever all the data lies between 0.1 and 0.2 for example, one single bin is displayed on the graph. I would like that empty bins are shown so that at a glance you can see if you are more distributed above 0 than below 0. Is this possible?&lt;/P&gt;

&lt;P&gt;Here is what I have tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | bin FAVG_ERR_DOSE_PRIM start=-1.0 end=1.0 bins=20 span=0.1 | chart count(FIELD_ID) by FAVG_ERR_DOSE_PRIM
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See postimg.org/image/swm3z7ddd/&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 16:55:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229430#M67937</guid>
      <dc:creator>pduflot</dc:creator>
      <dc:date>2015-11-17T16:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to show empty bins on my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229431#M67938</link>
      <description>&lt;P&gt;This is not exactly a pretty solution, but it works (at least in my preliminary testing).&lt;/P&gt;

&lt;P&gt;Change your search to contain this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | append [| stats count | fields - count | eval FAVG_ERR_DOSE_PRIM="-1,1" | makemv delim="," FAVG_ERR_DOSE_PRIM | mvexpand FAVG_ERR_DOSE_PRIM] | bin FAVG_ERR_DOSE_PRIM start=-1.0 end=1.0 bins=20 span=0.1 | chart count(FIELD_ID) by FAVG_ERR_DOSE_PRIM | makecontinuous FAVG_ERR_DOSE_PRIM
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is your search, but with an appended mininum and maximum value (-1 and 1). This in combination with the &lt;CODE&gt;makecontinuous&lt;/CODE&gt; at the end should create a chart to your needs:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/815i0742337A0CE7C036/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 07:58:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229431#M67938</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-11-18T07:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to show empty bins on my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229432#M67939</link>
      <description>&lt;P&gt;The command &lt;CODE&gt;makecontinuous&lt;/CODE&gt; should be all you need ...&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/Makecontinuous"&gt;http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/Makecontinuous&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      ... | chart count(FIELD_ID) by FAVG_ERR_DOSE_PRIM | makecontinuous FAVG_ERR_DOSE_PRIM start=-1.0 end=1.0 bins=20
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Nov 2015 09:59:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229432#M67939</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2015-11-18T09:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to show empty bins on my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229433#M67940</link>
      <description>&lt;P&gt;Oh, didn't realize you can specify start and end for that. This is even better.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 10:04:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229433#M67940</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-11-18T10:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to show empty bins on my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229434#M67941</link>
      <description>&lt;P&gt;Thanks. Actually this works on example data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | HEAD 1 | eval FAVG_ERR_DOSE_PRIM=0.1 | fields FAVG_ERR_DOSE_PRIM | bin FAVG_ERR_DOSE_PRIM span=0.1 start=-1.1 end=1.1 bins=22 | chart count(FIELD_ID) by FAVG_ERR_DOSE_PRIM | makecontinuous FAVG_ERR_DOSE_PRIM span=0.1 start=-1.1 end=1.09
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But as soon as the data comes from a stats function, it is buggy. The bins are initially correct but as data flows out of the pipeline the bins are adjusted and the final result is not as expected:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sca_rs_index2" sourcetype=recordspecif | stats avg(ERR_DOSE_PRIM) AS FAVG_ERR_DOSE_PRIM by FIELD_ID | bin FAVG_ERR_DOSE_PRIM span=0.1 start=-1.1 end=1.1 bins=22 | chart count(FIELD_ID) by FAVG_ERR_DOSE_PRIM | makecontinuous FAVG_ERR_DOSE_PRIM span=0.1 start=-1.1 end=1.09
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This leads to two bins with the -0.2:-0.1 label but none on the -0.1:0.0 label.&lt;/P&gt;

&lt;P&gt;Is there a way to avoid this?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 13:59:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229434#M67941</guid>
      <dc:creator>pduflot</dc:creator>
      <dc:date>2015-11-18T13:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to show empty bins on my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229435#M67942</link>
      <description>&lt;P&gt;This is weird. I don't know why this would happen.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 09:06:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229435#M67942</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-11-19T09:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to show empty bins on my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229436#M67943</link>
      <description>&lt;P&gt;Have you tried issuing the search command without the &lt;CODE&gt;bin ....&lt;/CODE&gt; part? This should not be needed at all, as the bin amount and size will be determined by the &lt;CODE&gt;makecontinuous&lt;/CODE&gt; command. Maybe this causes the error.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 07:50:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229436#M67943</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2015-11-20T07:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to show empty bins on my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229437#M67944</link>
      <description>&lt;P&gt;This is even worse without the bin command as new bins are created for each value:&lt;BR /&gt;
See &lt;A href="http://postimg.org/image/ilo0d7wi3/"&gt;http://postimg.org/image/ilo0d7wi3/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 09:43:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229437#M67944</guid>
      <dc:creator>pduflot</dc:creator>
      <dc:date>2015-11-20T09:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to show empty bins on my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229438#M67945</link>
      <description>&lt;P&gt;Strage, I was not aware of this behavior until now.&lt;/P&gt;

&lt;P&gt;Anyway, I have experimented a bit myself and found a solution that could be suitable. You can try adding the ranges to the &lt;CODE&gt;chart&lt;/CODE&gt; command instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [...] | stats avg(ERR_DOSE_PRIM) AS FAVG_ERR_DOSE_PRIM by FIELD_ID | chart count(FIELD_ID) over FAVG_ERR_DOSE_PRIM span=0.1 start=-1 end=1 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This worked for me - even with "live" data.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 10:17:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229438#M67945</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2015-11-20T10:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to show empty bins on my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229439#M67946</link>
      <description>&lt;P&gt;Well, it still does not wok in my case, same result as abose. I am on version 6.1.3 if it can matter. &lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 21:54:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229439#M67946</guid>
      <dc:creator>pduflot</dc:creator>
      <dc:date>2015-11-26T21:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to show empty bins on my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229440#M67947</link>
      <description>&lt;P&gt;Finally, the only way I could make this work as I wanted was to compute myself the total in each bin:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
| stats 
sum(eval(if(NERR_DOSE_PRIM&amp;lt;-1.2,1,0))) AS NERR_DOSE_PRIM_LT012
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-1.2 AND NERR_DOSE_PRIM&amp;lt;-1.1,1,0))) AS NERR_DOSE_PRIM_012LT011
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-1.1 AND NERR_DOSE_PRIM&amp;lt;-1.0,1,0))) AS NERR_DOSE_PRIM_011LT010
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-1.0 AND NERR_DOSE_PRIM&amp;lt;-0.9,1,0))) AS NERR_DOSE_PRIM_010LT009
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-0.9 AND NERR_DOSE_PRIM&amp;lt;-0.8,1,0))) AS NERR_DOSE_PRIM_009LT008
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-0.8 AND NERR_DOSE_PRIM&amp;lt;-0.7,1,0))) AS NERR_DOSE_PRIM_008LT007
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-0.7 AND NERR_DOSE_PRIM&amp;lt;-0.6,1,0))) AS NERR_DOSE_PRIM_007LT006
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-0.6 AND NERR_DOSE_PRIM&amp;lt;-0.5,1,0))) AS NERR_DOSE_PRIM_006LT005
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-0.5 AND NERR_DOSE_PRIM&amp;lt;-0.4,1,0))) AS NERR_DOSE_PRIM_005LT004
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-0.4 AND NERR_DOSE_PRIM&amp;lt;-0.3,1,0))) AS NERR_DOSE_PRIM_004LT003
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-0.3 AND NERR_DOSE_PRIM&amp;lt;-0.2,1,0))) AS NERR_DOSE_PRIM_003LT002
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-0.2 AND NERR_DOSE_PRIM&amp;lt;-0.1,1,0))) AS NERR_DOSE_PRIM_002LT001
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=-0.1 AND NERR_DOSE_PRIM&amp;lt;0.00,1,0))) AS NERR_DOSE_PRIM_001LT000
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=0.0 AND NERR_DOSE_PRIM&amp;lt;0.1,1,0))) AS NERR_DOSE_PRIM_000LT001
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=0.1 AND NERR_DOSE_PRIM&amp;lt;0.2,1,0))) AS NERR_DOSE_PRIM_001LT002
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=0.2 AND NERR_DOSE_PRIM&amp;lt;0.3,1,0))) AS NERR_DOSE_PRIM_002LT003
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=0.3 AND NERR_DOSE_PRIM&amp;lt;0.4,1,0))) AS NERR_DOSE_PRIM_003LT004
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=0.4 AND NERR_DOSE_PRIM&amp;lt;0.5,1,0))) AS NERR_DOSE_PRIM_004LT005
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=0.5 AND NERR_DOSE_PRIM&amp;lt;0.6,1,0))) AS NERR_DOSE_PRIM_005LT006
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=0.6 AND NERR_DOSE_PRIM&amp;lt;0.7,1,0))) AS NERR_DOSE_PRIM_006LT007
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=0.7 AND NERR_DOSE_PRIM&amp;lt;0.8,1,0))) AS NERR_DOSE_PRIM_007LT008
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=0.8 AND NERR_DOSE_PRIM&amp;lt;0.9,1,0))) AS NERR_DOSE_PRIM_008LT009
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=0.9 AND NERR_DOSE_PRIM&amp;lt;1.0,1,0))) AS NERR_DOSE_PRIM_009LT010
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=1.0 AND NERR_DOSE_PRIM&amp;lt;1.1,1,0))) AS NERR_DOSE_PRIM_010LT011
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=1.1 AND NERR_DOSE_PRIM&amp;lt;1.2,1,0))) AS NERR_DOSE_PRIM_011LT012
, sum(eval(if(NERR_DOSE_PRIM&amp;gt;=1.2,1,0))) AS NERR_DOSE_PRIM_GT012
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jan 2016 14:47:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-empty-bins-on-my-chart/m-p/229440#M67947</guid>
      <dc:creator>pduflot</dc:creator>
      <dc:date>2016-01-11T14:47:17Z</dc:date>
    </item>
  </channel>
</rss>

