root@ip-192-20-50-190:# df -hT | grep -v overlay | grep -v shm | grep \/dev | grep -v devtmpfs
/dev/nvme0n1p2 ext4 120G 55G 61G 48% /
/dev/nvme4n1 ext4 99G 291M 94G 1% /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/vol-0b3037141a35cb423
/dev/nvme3n1 ext4 493G 426G 46G 91% /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/vol-0aca325ffd5059834
/dev/nvme1n1 ext4 20G 693M 18G 4% /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/vol-060825f3bf5c1f862
/dev/nvme2n1 ext4 246G 189G 47G 81% /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/vol-0d94c8142d28f9753
man df
:--output[=FIELD_LIST] use the output format defined by FIELD_LIST, or print all fields if FIELD_LIST is omitted. И далее внизу: FIELD_LIST is a comma-separated list of columns to be included. Valid field names are: 'source', 'fstype', 'itotal', 'iused', 'iavail', 'ipcent', 'size', 'used', 'avail', 'pcent', 'file' and 'target' (see info page).
df -h --output="source,pcent" | grep \/dev | tr -d "/dev/" | tr -d "%" | awk '{print "{\"disk_"$1"\"",":"$2"}"}' | tr -d " "| sed -z 's/\n/,/g' | sed -z 's/^/{/;s/.$/}/g'
{{"disk_nm0n1p2":52},{"disk_nm4n1":1},{"disk_nm3n1":91},{"disk_nm1n1":4},{"disk_nm2n1":81}}
jq --arg k1 "first" --arg v1 "32" --arg k2 "second" --arg v2 "32" --arg k3 "third" --arg v3 "33" '. | .[$k1]=$v1 | .[$k2]=$v2 | .[$k3]=$v3' <<<'{}' ;
{
"first": "32",
"second": "32",
"third": "33"
}
df -h --output="source,pcent" | tr -s ' ' | csvjson -d' '