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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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