Splunk Search

Pie chart syntax for disk use

fsrodriguez
New Member

I have the values I just don't have the syntax.

host="app-1" source="df" | stats max(storage_used) as storage_used by host 

Where do I include: max(TotalMBytes)?

Not sure how to convert that into a pie chart.

Tags (2)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

HI @fsrodriguez,

With your provided search I think you are looking for like below search.

host="app-1" source="df" 
| stats max(storage_used) as storage_used max(TotalMBytes) as TotalMBytes
| eval storage_unused=(TotalMBytes-storage_used) 
| table storage_used storage_unused 
| transpose

Convert viz to a pie chart. Bytes to GB is pending in this search.

Another thing I'm guessing you want the latest status of disk volume of the particular host. So can you please try the search?

host="app-1" source="df" | head 1 |
| eval storage_unused=(TotalMBytes-storage_used) 
| table storage_used storage_unused 
| transpose

Convert viz to a pie chart. Bytes to GB is pending in this search.

Thanks

View solution in original post

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

HI @fsrodriguez,

With your provided search I think you are looking for like below search.

host="app-1" source="df" 
| stats max(storage_used) as storage_used max(TotalMBytes) as TotalMBytes
| eval storage_unused=(TotalMBytes-storage_used) 
| table storage_used storage_unused 
| transpose

Convert viz to a pie chart. Bytes to GB is pending in this search.

Another thing I'm guessing you want the latest status of disk volume of the particular host. So can you please try the search?

host="app-1" source="df" | head 1 |
| eval storage_unused=(TotalMBytes-storage_used) 
| table storage_used storage_unused 
| transpose

Convert viz to a pie chart. Bytes to GB is pending in this search.

Thanks

0 Karma

fsrodriguez
New Member

wow that looks awesome! Thank you soo much! I appreciate the help!

0 Karma

micahkemp
Champion

A pie chart is only going to work with one value broken out by label, and needs to be split by that label. Try something like:

host="app-1" source="df" | timechart max(storage_used) BY filesystem
0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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