Dashboards & Visualizations

Using dbinspect, how to show space used as a percentage?

smudge797
Path Finder

I'm using a gauge in a dashboard which is showing space used by total size on disk:

| dbinspect index=* OR index=_* | where splunk_server like("splunkindexername%")    | eval SizeOnDiskGB=sizeOnDiskMB/1024    | eval RawSizeGB=rawSize/1024/1024/1024    | stats sum(SizeOnDiskGB) AS TotalSizeOnDiskGB     | eval TotalSizeOnDiskGB=round(TotalSizeOnDiskGB, 0)   | gauge TotalSizeOnDiskGB 0 42000 51000 60000

I want to show percentage of space used instead.. Any ideas?

Thanks

0 Karma

jeffland
SplunkTrust
SplunkTrust

You will of course need either a figure of the available space or knowledge of the total size of the disk. When you have that, it's a simple thing such as

your_search_without_gauge | eval percent_used=TotalSizeOnDiskGB/(freeSpaceGB+TotalSizeOnDiskGB)

or

your_search_without_gauge | eval percent_used=TotalSizeOnDiskGB/totalDiskGB

From there you could output percent_used to a single value display.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...