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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...