<?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 Create pie chart that shows values &amp;gt;=0 also when there are no results! in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-pie-chart-that-shows-values-gt-0-also-when-there-are-no/m-p/328145#M40529</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
i want to create a pie chart by different values what works well. I have the following problem: the pie chart shall display 0 when there is no event. I created a search that results a dummy value of 0: |appendpipe [stats count | eval NoResult= "0" | where count=0]&lt;/P&gt;

&lt;P&gt;My query: index=abc OR index=def Statuscode="12345"|chart count by index||appendpipe [stats count | eval NoResult= "0" | where count=0]&lt;/P&gt;

&lt;P&gt;how is it possible to "combine" the search "chart count by index" with the dummy value?&lt;/P&gt;

&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2017 09:16:46 GMT</pubDate>
    <dc:creator>reschal</dc:creator>
    <dc:date>2017-10-27T09:16:46Z</dc:date>
    <item>
      <title>Create pie chart that shows values &gt;=0 also when there are no results!</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-pie-chart-that-shows-values-gt-0-also-when-there-are-no/m-p/328145#M40529</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
i want to create a pie chart by different values what works well. I have the following problem: the pie chart shall display 0 when there is no event. I created a search that results a dummy value of 0: |appendpipe [stats count | eval NoResult= "0" | where count=0]&lt;/P&gt;

&lt;P&gt;My query: index=abc OR index=def Statuscode="12345"|chart count by index||appendpipe [stats count | eval NoResult= "0" | where count=0]&lt;/P&gt;

&lt;P&gt;how is it possible to "combine" the search "chart count by index" with the dummy value?&lt;/P&gt;

&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 09:16:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-pie-chart-that-shows-values-gt-0-also-when-there-are-no/m-p/328145#M40529</guid>
      <dc:creator>reschal</dc:creator>
      <dc:date>2017-10-27T09:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create pie chart that shows values &gt;=0 also when there are no results!</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-pie-chart-that-shows-values-gt-0-also-when-there-are-no/m-p/328146#M40530</link>
      <description>&lt;P&gt;@reschal, appendpipe should add a entry with 0 value which should be visible in your pie chart. If you have more than 10 results and see &lt;CODE&gt;others&lt;/CODE&gt; slice with one or more results,  there is also a chance that Minimum Slice size threshold is being applied. If it is the case you need to change the &lt;CODE&gt;threshold option to 0 to see the slice with 0 value&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Following is run anywhere search based on Splunk _internal index&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=splunkd
|  stats count by group
|  sort - count
|  head 20
|  appendpipe 
   [|  makeresults
  |  eval group="UnKnown",count=0
  |  table group count]
  | dedup group&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the Simple XML Chart Configuration for Setting minimum size threshold &lt;CODE&gt;charting.chart.sliceCollapsingThreshold&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;option name="charting.chart.sliceCollapsingThreshold"&amp;gt;0&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Oct 2017 13:39:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-pie-chart-that-shows-values-gt-0-also-when-there-are-no/m-p/328146#M40530</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-10-27T13:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create pie chart that shows values &gt;=0 also when there are no results!</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-pie-chart-that-shows-values-gt-0-also-when-there-are-no/m-p/328147#M40531</link>
      <description>&lt;P&gt;Thx for your support. Your query works but is there any option that my chart only shows the value Unknown(=0) if there is no other event? In case that my search shows some events the "dummy event" shall be removed.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 14:25:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-pie-chart-that-shows-values-gt-0-also-when-there-are-no/m-p/328147#M40531</guid>
      <dc:creator>reschal</dc:creator>
      <dc:date>2017-10-27T14:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create pie chart that shows values &gt;=0 also when there are no results!</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Create-pie-chart-that-shows-values-gt-0-also-when-there-are-no/m-p/328148#M40532</link>
      <description>&lt;P&gt;Yes you should do a &lt;CODE&gt;dedup&lt;/CODE&gt; by &lt;CODE&gt;index&lt;/CODE&gt; in the end i.e. &lt;CODE&gt;| dedup index&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Since we are appending dummy value/s in the end of the result, if multiple values for same field value remains it will pick up the first (in other words the one from the query result). As you can see I have &lt;CODE&gt;| dedup group&lt;/CODE&gt; as my final pipe.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 16:25:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Create-pie-chart-that-shows-values-gt-0-also-when-there-are-no/m-p/328148#M40532</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-10-27T16:25:16Z</dc:date>
    </item>
  </channel>
</rss>

