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!

Monitoring Postgres with OpenTelemetry

Behind every business-critical application, you’ll find databases. These behind-the-scenes stores power ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...

Splunk Edge Processor | Popular Use Cases to Get Started with Edge Processor

Splunk Edge Processor offers more efficient, flexible data transformation – helping you reduce noise, control ...