Dashboards & Visualizations

How to display the Total Space and Consumed in a single pie chart?

bollam
Path Finder

Hello, I have following content in the event and I want to display TotalSpace and ConsumedSpace in the single pie chart.
For an instance: if the TotalSpace is 1000 and the ConsumedSpace is 250 then the 1/4th of the pie should display as ConsumedSpace over TotalSpace.

Event:
This is total space is TotalSpace=2000
This is Available space is AvailableSpace=1000
Name="Bollam"

Query which I had written:
index=sai_core source="size" Name="Bollam" | eval ConsumedSpace = TotalSpace - AvailableSpace
| stats first(ConsumedSpace) as ConsumedSpace by TotalSpace

Tags (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi
Have you tried transpose command?

Can you please try this?

index=sai_core source="size" Name="Bollam" | head 1
| eval ConsumedSpace = TotalSpace - AvailableSpace 
| table ConsumedSpace AvailableSpace 
| transpose

Please try below sample search and set pie chart in viz.

| makeresults 
| eval TotalSpace=1000,AvailableSpace=250 
| eval ConsumedSpace = TotalSpace - AvailableSpace 
| table ConsumedSpace AvailableSpace 
| transpose

Thanks

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...