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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...