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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...