Dashboards & Visualizations

Visualize fields as percentage in pie chart

harryvdtol
Explorer

Hello,

I have 3 rows with numeric data, trying to visualize this in a pie chart.

The first value (totalval) is the total value
I want to the other values to be a percentage of the total value and so only show the 2 other values (typeA and typeB)

type           total
---------------------
totalval    4151
typeA       1442
typeB        17

Trying for some hours, i am stuck, any help is appreciated

Regards,

Harry

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| eval totalval=if(type="totalval",total,null())
| eventstats values(totalval) as totalval
| where type!="totalval"
| eval percent=100*total/totalval

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| eval totalval=if(type="totalval",total,null())
| eventstats values(totalval) as totalval
| where type!="totalval"
| eval percent=100*total/totalval
0 Karma

harryvdtol
Explorer

Very impressive and educational.

Thank you.

Regards,

Harry

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...