<?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: Including event count in legend of timechart in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255894#M43482</link>
    <description>&lt;P&gt;Thanks alemarzu.&lt;/P&gt;

&lt;P&gt;I gave that a go.&lt;BR /&gt;
I get a single entry in the legend of "VALUE_json" with a total of all events found.&lt;BR /&gt;
(There should be three values in the legend)&lt;/P&gt;

&lt;P&gt;I tried it again and replaced "eval my_fieldname=sourcetype" with "eval my_fieldname=my_fieldname".&lt;/P&gt;

&lt;P&gt;I now get the three values listed in the legend but beside each is a the same event count. i.e. the total event count across all three values.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 11:26:17 GMT</pubDate>
    <dc:creator>splunk_svc</dc:creator>
    <dc:date>2020-09-29T11:26:17Z</dc:date>
    <item>
      <title>Including event count in legend of timechart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255892#M43480</link>
      <description>&lt;P&gt;Hi Splunkers.&lt;BR /&gt;
I'm trying to get event counts for timechart values displayed in the legend.&lt;BR /&gt;
i.e. In the legend I want to display the event count, in addition to each value.&lt;/P&gt;

&lt;P&gt;I am trying to include the count due to a couple of values on the timechart hiding others, having a much higher record count in comparison the the rest.&lt;/P&gt;

&lt;P&gt;I am already doing something similar for a pie chart:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[query] | stats count by my_fieldname | eval my_fieldname=my_fieldname.", ".count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(...with the eval command appending the count to the value displayed in the legend)&lt;/P&gt;

&lt;P&gt;I don't seem to be able to get this working for a timechart.  If I do the following, I end up with only one value appearing in the legend as "NULL"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[query]  |  eval my_fieldname=my_fieldname.", ".count | timechart count by responsestatus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm pretty sure this has to be manipulated before the timechart as there don't seem to be any timechart options to include the record count.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 00:57:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255892#M43480</guid>
      <dc:creator>splunk_svc</dc:creator>
      <dc:date>2016-10-17T00:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Including event count in legend of timechart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255893#M43481</link>
      <description>&lt;P&gt;Hi @splunk_svc&lt;/P&gt;

&lt;P&gt;Is it this what you are looking for ? This is a working example.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | eventstats count by sourcetype | eval my_fieldname=sourcetype.", ".count | timechart count by my_fieldname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it helps.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt; query outcome&lt;BR /&gt;
&lt;IMG src="https://s15.postimg.org/s8urvpl23/example.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 01:48:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255893#M43481</guid>
      <dc:creator>alemarzu</dc:creator>
      <dc:date>2016-10-17T01:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Including event count in legend of timechart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255894#M43482</link>
      <description>&lt;P&gt;Thanks alemarzu.&lt;/P&gt;

&lt;P&gt;I gave that a go.&lt;BR /&gt;
I get a single entry in the legend of "VALUE_json" with a total of all events found.&lt;BR /&gt;
(There should be three values in the legend)&lt;/P&gt;

&lt;P&gt;I tried it again and replaced "eval my_fieldname=sourcetype" with "eval my_fieldname=my_fieldname".&lt;/P&gt;

&lt;P&gt;I now get the three values listed in the legend but beside each is a the same event count. i.e. the total event count across all three values.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:26:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255894#M43482</guid>
      <dc:creator>splunk_svc</dc:creator>
      <dc:date>2020-09-29T11:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Including event count in legend of timechart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255895#M43483</link>
      <description>&lt;P&gt;Can you show me how did you adapt the query I've posted or some data samples ?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 13:27:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255895#M43483</guid>
      <dc:creator>alemarzu</dc:creator>
      <dc:date>2016-10-17T13:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Including event count in legend of timechart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255896#M43484</link>
      <description>&lt;P&gt;are you doing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | eventstats count by my_fieldname| eval my_fieldname=sourcetype.", ".count | timechart count by my_fieldname
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Oct 2016 15:07:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255896#M43484</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2016-10-17T15:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Including event count in legend of timechart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255897#M43485</link>
      <description>&lt;P&gt;Got it.&lt;BR /&gt;
Using "sourcetype" in the query was converting the value label into "_json".&lt;/P&gt;

&lt;P&gt;Replacing sourcetype in alemarzu's query above with my_fieldname did the trick.&lt;/P&gt;

&lt;P&gt;Thanks folks.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 22:49:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255897#M43485</guid>
      <dc:creator>splunk_svc</dc:creator>
      <dc:date>2016-10-17T22:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Including event count in legend of timechart</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255898#M43486</link>
      <description>&lt;P&gt;Nice, im glad it helped. Happy splunking!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 00:17:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Including-event-count-in-legend-of-timechart/m-p/255898#M43486</guid>
      <dc:creator>alemarzu</dc:creator>
      <dc:date>2016-10-18T00:17:05Z</dc:date>
    </item>
  </channel>
</rss>

