Splunk Search

display sum value in pie chart

ashabc
Contributor

I have used in the past count value in the pie chart. Now I need to display sum value in the chart. How can I do this?

| stats sum(TotalCost) by ProductCode

My intention is to display the sum(TotalCost) of each productType in the pie chart.

0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

Here's an example based on _internal data:

index=_internal bytes=* | stats sum(bytes) as sum by sourcetype | eval sourcetype = sourcetype . " (sum=" . sum . ")"

By changing the sourcetype field I'm basically changing the pie chart labels.

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

Here's an example based on _internal data:

index=_internal bytes=* | stats sum(bytes) as sum by sourcetype | eval sourcetype = sourcetype . " (sum=" . sum . ")"

By changing the sourcetype field I'm basically changing the pie chart labels.

ashabc
Contributor

Thank you. It worked.

0 Karma

woodcock
Esteemed Legend

Like this:

... | chart sum(TotalCost) by ProductCode
0 Karma

ashabc
Contributor

Thanks for a pormpt response, Woodcok. Not sure my question is clear. I want to display the actual value i.e. the sum of TotalCost for each product type in the pie chart. ... | chart sum(TotalCost) by ProductCode will only display the pie chart and not the actual values.

0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...