<?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 do I create a stacked bar chart sorted by host. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-stacked-bar-chart-sorted-by-host/m-p/161004#M45552</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | chart count over info by host  | addtotals fieldname="Total" | table info Total * | sort - Total | head 5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should give you a nice table with info (animal name) as first column, Total (total count) and count by host (as separate columns). Just select stacked option in the visualization and you're set.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Aug 2015 19:33:59 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2015-08-05T19:33:59Z</dc:date>
    <item>
      <title>How do I create a stacked bar chart sorted by host.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-stacked-bar-chart-sorted-by-host/m-p/161001#M45549</link>
      <description>&lt;P&gt;I am still learning all the nice functionality in Splunk, but have some trouble with this.&lt;/P&gt;

&lt;P&gt;Eks struktur:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Aug 05 09:27:33 palito dog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here I got two interesting fields:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=palito
info=dog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Aug 05 09:27 palito dog
Aug 05 09:28 habo cat
Aug 05 09:29 jago horse
Aug 05 09:30 palito cat
Aug 05 09:31 palito cat
Aug 05 09:32 habo cat
Aug 05 09:33 jago horse
Aug 05 09:34 palito horse
Aug 05 09:35 habo dog 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;From this I like to get the graph sorted on the &lt;STRONG&gt;info&lt;/STRONG&gt; (animal) so I get top 5 animals using this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; * | top limit=5 info
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This give three column, &lt;STRONG&gt;cat=4&lt;/STRONG&gt;, &lt;STRONG&gt;dog=2&lt;/STRONG&gt; and &lt;STRONG&gt;horse=3&lt;/STRONG&gt;&lt;BR /&gt;
So far I am full control of the situation.&lt;/P&gt;

&lt;P&gt;But then I like to also see the representation of the &lt;STRONG&gt;hosts&lt;/STRONG&gt;, so these data gives:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cat 4       palito 2    habo 2
dog 2       palito 1    habo 1
horse 3     palito 1    jago 2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I know how to select format-stacked, but not how to get &lt;STRONG&gt;3&lt;/STRONG&gt; columns with &lt;STRONG&gt;4 cat&lt;/STRONG&gt;, where I color separate it with &lt;STRONG&gt;2 palito&lt;/STRONG&gt;, and &lt;STRONG&gt;2 habo&lt;/STRONG&gt; etc.&lt;BR /&gt;
So It should be 3 columns with percent host showing in each of them.&lt;/P&gt;

&lt;P&gt;I tried, but not working&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; * | top limit=5 info by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example on how the three column should look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; h
 h              j
 p      h       j
 p      p       p
 --------------------
 cat    dog     horse
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where p,h, and j are different colors. &lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 07:57:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-stacked-bar-chart-sorted-by-host/m-p/161001#M45549</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2015-08-05T07:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a stacked bar chart sorted by host.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-stacked-bar-chart-sorted-by-host/m-p/161002#M45550</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; |  timechart count by host limit=10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you are on search page:&lt;BR /&gt;
 1. Goto Visualization and select bar chart&lt;BR /&gt;
 2. Select format button&lt;BR /&gt;
 3. Select stack mode as: Stacked&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 10:09:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-stacked-bar-chart-sorted-by-host/m-p/161002#M45550</guid>
      <dc:creator>shrirangphadke</dc:creator>
      <dc:date>2015-08-05T10:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a stacked bar chart sorted by host.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-stacked-bar-chart-sorted-by-host/m-p/161003#M45551</link>
      <description>&lt;P&gt;This does not help.&lt;BR /&gt;
It only shows hits over time for each host. I am not interested in time.&lt;BR /&gt;
I need to see number of each type of animals (&lt;STRONG&gt;info&lt;/STRONG&gt;) and each column should show stacked hosts.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 10:20:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-stacked-bar-chart-sorted-by-host/m-p/161003#M45551</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2015-08-05T10:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a stacked bar chart sorted by host.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-stacked-bar-chart-sorted-by-host/m-p/161004#M45552</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | chart count over info by host  | addtotals fieldname="Total" | table info Total * | sort - Total | head 5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should give you a nice table with info (animal name) as first column, Total (total count) and count by host (as separate columns). Just select stacked option in the visualization and you're set.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 19:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-stacked-bar-chart-sorted-by-host/m-p/161004#M45552</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-05T19:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a stacked bar chart sorted by host.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-stacked-bar-chart-sorted-by-host/m-p/161005#M45553</link>
      <description>&lt;P&gt;Thank you, this is relay close to what I need.&lt;BR /&gt;
To not add Total to every column I removed it, so it looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; * | chart count over info by host  | addtotals fieldname="Total" | table info Total * | sort - Total | head 5 | field - Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I have a problem with &lt;STRONG&gt;addtotals&lt;/STRONG&gt;.  It sums up all the fields, that is OK, but if the field name is a number, It add the number of the field name to the &lt;STRONG&gt;Total&lt;/STRONG&gt;.  For me that seems to be a bug. Is three a way around it?&lt;/P&gt;

&lt;P&gt;This is what I like to get:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;info\host   palito  habo    jago    Total   
-----------------------------------------
cat         2       2               4
dog         1       1               2
82          1               2       3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is what Splunk gives, look at &lt;STRONG&gt;Total&lt;/STRONG&gt; for the &lt;STRONG&gt;82&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;info\host   palito  habo    jago    Total   
-----------------------------------------
cat         2       2               4
dog         1       1               2
82          1               2       85
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Aug 2015 06:38:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-stacked-bar-chart-sorted-by-host/m-p/161005#M45553</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2015-08-06T06:38:25Z</dc:date>
    </item>
  </channel>
</rss>

