Splunk Search

Stacked Bar Chart - Disk Usage

lanying
Explorer

Now, I am collecting a disk space log by using a WMI.
I want to make a stacked bar chart about disk space.
How can I make a stack bar chart for Free space & Used space by driver (C: , 😧 ..)
Thanks.

Collect Command :::
[WMI:DiskSpace]
interval = 30
wql = Select Name , FreeSpace , Size From Win32_LocalDisk where DriveType=3
disabled = 0

Collected Log Data :::
20110802134951.921875
FreeSpace=35046666240
Name=C:
Size=53694595072
wmi_type=DiskSpace

Tags (3)
0 Karma

lanying
Explorer

감사감사...(thank you for your help)

0 Karma

peter_payne
New Member

Fishing...

0 Karma

Ayn
Legend

No problem. If the answer solved your problem, please mark it as 'accepted'. That way it'll be correctly labeled in the system. Thanks.

0 Karma

Ayn
Legend

Since used space = Size - FreeSpace, you can calculate the difference and chart it in a stacked chart where the total height of each bar will be equivalent to the total space:

<yourbasesearch>
| eval UsedSpace=Size-FreeSpace
| chart first(UsedSpace),first(FreeSpace)
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...