I'd like to set up pie charts for disk space from data coming from the "df" scripts from the UNIX app. In looking through the charting docs, I can see how to chart "count" data, but I am unclear how to chart a single value, coming from the "df" script. I tried the "transpose" command, but only "UsedG" is coming up on the chart.
The search below was developed with help from the Splunk Answers KB. Notice that we convert the "Used" field to gigabytes. It goes to a field called "UsedG", but this seems to screw up the table. It adds "UsedG" to the table, even though it is not defined in the search.
I basically want to use "Used" and "Available", which should give a complete pie chart. If there was a way to chart "Size" and "Used", that would probably be more accurate.
Thanks for the help!
host="myhost" sourcetype="df"
| multikv fields Filesystem Type Size Used Avail UsePct MountedOn
| search /home | table MountedOn Size Used Avail
| eval UsedG = case(match(Used,"[M]"),round(tonumber(rtrim(Used,"M"))/1024,3),
match(Used,"[T]"),round(tonumber(rtrim(Used,"T"))*1024,3),
match(Used,"[G]"),round(tonumber(rtrim(Used,"G")),3))
... View more