Dashboards & Visualizations

Visualize fields as percentage in pie chart

harryvdtol
Path Finder

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
Path Finder

Very impressive and educational.

Thank you.

Regards,

Harry

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...