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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...