<?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: Concatenate field and count to display label in pie chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76988#M19479</link>
    <description>&lt;P&gt;Hello &lt;/P&gt;

&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|  eval UserPlusCount = Username. "-". count |...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If it doesnt works, rename the count as other field&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Mon, 30 Sep 2013 15:15:41 GMT</pubDate>
    <dc:creator>gfuente</dc:creator>
    <dc:date>2013-09-30T15:15:41Z</dc:date>
    <item>
      <title>Concatenate field and count to display label in pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76987#M19478</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;This is my query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Username="*"   | top limit=10000 Username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives me a table with many rows, where the first row looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Username               count    percent
Vivek Lamba (lambav)   607      10.483592
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I then view this data using a Pie Chart in my Dashboard.&lt;/P&gt;

&lt;P&gt;Currently the labels on the pie chart only display the Username. How can I change my query so that the labels display:&lt;BR /&gt;
"Username - count"&lt;BR /&gt;
(i.e. "Vivek Lamba (lambav) - 607")&lt;/P&gt;

&lt;P&gt;I've tried adding in an eval command like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Username="*"   |  eval UserPlusCount = Username + "-" + count | top limit=10000 UserPlusCount
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...but I get 'No results found"&lt;/P&gt;

&lt;P&gt;What am I doing wrong?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2013 15:10:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76987#M19478</guid>
      <dc:creator>philallen1</dc:creator>
      <dc:date>2013-09-30T15:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate field and count to display label in pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76988#M19479</link>
      <description>&lt;P&gt;Hello &lt;/P&gt;

&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|  eval UserPlusCount = Username. "-". count |...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If it doesnt works, rename the count as other field&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2013 15:15:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76988#M19479</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2013-09-30T15:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate field and count to display label in pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76989#M19480</link>
      <description>&lt;P&gt;Hi gfuente - thanks for you're unbelievably quick reply.&lt;/P&gt;

&lt;P&gt;I tried this:&lt;BR /&gt;
Username="*"  | eval UserPlusCount = Username. "-". count | top limit=10000 UserPlusCount&lt;BR /&gt;
as you suggested and it didn't work. "No results found"&lt;/P&gt;

&lt;P&gt;What do you mean by:&lt;BR /&gt;
"rename the count as other field"?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2013 15:19:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76989#M19480</guid>
      <dc:creator>philallen1</dc:creator>
      <dc:date>2013-09-30T15:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate field and count to display label in pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76990#M19481</link>
      <description>&lt;P&gt;I just tried:&lt;/P&gt;

&lt;P&gt;Username="*"  | eval UserPlusCount = Username. "-". Username| top limit=10000 UserPlusCount&lt;/P&gt;

&lt;P&gt;And that did bring back data in a table like so:&lt;/P&gt;

&lt;P&gt;Vivek Lamba (lambav) - Vivek Lamba (lambav)     607        10.483592&lt;/P&gt;

&lt;P&gt;However, when I change "Username" to "count" it doesn't work at all! Any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2013 15:21:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76990#M19481</guid>
      <dc:creator>philallen1</dc:creator>
      <dc:date>2013-09-30T15:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate field and count to display label in pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76991#M19482</link>
      <description>&lt;P&gt;try:&lt;/P&gt;

&lt;P&gt;Instead of top, use: ... | stats count as myfield by Username | eval UserPlusCount = Username. "-". myfield |...&lt;/P&gt;

&lt;P&gt;EDIT: Now I noticed, you have to do the eval after the top command, then you have the count field, and you can use it in the eval.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2013 15:23:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76991#M19482</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2013-09-30T15:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate field and count to display label in pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76992#M19483</link>
      <description>&lt;P&gt;Sorry I'm new to Splunk. How would the full query look? When I remove the 'top' piece of the query it breaks altogether. What should I replace it with?&lt;/P&gt;

&lt;P&gt;Username="*"  | stats count as Username by myfield | eval UserPlusCount = Username. "-". myfield | ...(i.e. what should go here)...&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2013 15:42:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76992#M19483</guid>
      <dc:creator>philallen1</dc:creator>
      <dc:date>2013-09-30T15:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate field and count to display label in pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76993#M19484</link>
      <description>&lt;P&gt;Hi Can we add a dynamic result to a header ?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 07:21:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Concatenate-field-and-count-to-display-label-in-pie-chart/m-p/76993#M19484</guid>
      <dc:creator>gun1989</dc:creator>
      <dc:date>2016-03-22T07:21:24Z</dc:date>
    </item>
  </channel>
</rss>

