<?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 Constants in Splunk Bar Graph Charts in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58341#M3083</link>
    <description>&lt;P&gt;I have a query like this - which charts the number of grapes and pears in a fruit cart&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="fruitlog" type="pear" OR type="grape" | eval InStock=10 | chart first(InStock) as InStock,count(eval(type="pear")) AS numPears, count(eval(type="grape")) AS numGrapes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The InStock amount is the total number of fruits that is UNRELATED to the number of Pears and Grapes.&lt;/P&gt;

&lt;P&gt;When I put this up on a dashboard, NO bar appears for the InStock Value of 10. I see numPears and I see numGrapes.&lt;/P&gt;

&lt;P&gt;Any ideas so as to why this CONSTANT value would not display on a chart ? It might sound stupid to even have it there, but I need for it to show for comparison.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Sep 2012 19:54:13 GMT</pubDate>
    <dc:creator>asarolkar</dc:creator>
    <dc:date>2012-09-12T19:54:13Z</dc:date>
    <item>
      <title>Constants in Splunk Bar Graph Charts</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58341#M3083</link>
      <description>&lt;P&gt;I have a query like this - which charts the number of grapes and pears in a fruit cart&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="fruitlog" type="pear" OR type="grape" | eval InStock=10 | chart first(InStock) as InStock,count(eval(type="pear")) AS numPears, count(eval(type="grape")) AS numGrapes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The InStock amount is the total number of fruits that is UNRELATED to the number of Pears and Grapes.&lt;/P&gt;

&lt;P&gt;When I put this up on a dashboard, NO bar appears for the InStock Value of 10. I see numPears and I see numGrapes.&lt;/P&gt;

&lt;P&gt;Any ideas so as to why this CONSTANT value would not display on a chart ? It might sound stupid to even have it there, but I need for it to show for comparison.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 19:54:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58341#M3083</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2012-09-12T19:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Constants in Splunk Bar Graph Charts</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58342#M3084</link>
      <description>&lt;P&gt;It's not that it's a constant, it's that your search will generate one row with multiple columns and the first column will be the one used by the bar chart for the Y-axis label. Try removing the first part of your &lt;CODE&gt;chart&lt;/CODE&gt; command and you'll see that &lt;CODE&gt;numPears&lt;/CODE&gt; will disappear from the bar chart and instead be used as a label.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 20:18:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58342#M3084</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-09-12T20:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Constants in Splunk Bar Graph Charts</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58343#M3085</link>
      <description>&lt;P&gt;So, how would you recommend I frame my search.&lt;/P&gt;

&lt;P&gt;A timechart is not desired here but just a chart.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 20:27:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58343#M3085</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2012-09-12T20:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Constants in Splunk Bar Graph Charts</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58344#M3086</link>
      <description>&lt;P&gt;Add this to the end of your search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | transpose | rename "row 1" as count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The trick is to get your data in multiple rows, not across multiple columns.&lt;/P&gt;

&lt;P&gt;You can also replace 'chart' with 'stats'  &lt;/P&gt;

&lt;P&gt;A neater search might be &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="fruitlog" type="pear" OR type="grape"
| stats count by type 
| appendpipe [ head 1 | eval type="InStock" | eval count=10 | fields type count ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The 1st 2 lines gets the count per type (which will graph as-is)&lt;BR /&gt;&lt;BR /&gt;
the last line just spoofs an entry for InStock&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 21:51:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58344#M3086</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2012-09-12T21:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Constants in Splunk Bar Graph Charts</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58345#M3087</link>
      <description>&lt;P&gt;sourcetype="fruitlog" type="pear" OR type="grape" | eval InStock=10 | chart first(InStock) as InStock,count(eval(type="pear")) AS numPears, count(eval(type="grape")) AS numGrapes | transpose | rename "row 1" as count ???&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 22:02:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58345#M3087</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2012-09-12T22:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Constants in Splunk Bar Graph Charts</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58346#M3088</link>
      <description>&lt;P&gt;yeah - i don't have your data, but this seems to be similar to what you're using :&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=_internal | eval instock=10 | stats first(instock) as instock count(eval(group=="pipeline")) as pipe count(eval(group=="queue")) as queue | transpose | rename "row 1"&lt;/CODE&gt; as count`  &lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=_internal group="pipeline" OR group="queue" | stats count by group | appendpipe [ head 1 | eval group="InStock" | eval count=10 | fields group count ]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2012 22:09:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Constants-in-Splunk-Bar-Graph-Charts/m-p/58346#M3088</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2012-09-12T22:09:27Z</dc:date>
    </item>
  </channel>
</rss>

