Files
telegraf-bcachefs-input/bcachefs_perf.sh
T

18 lines
371 B
Bash
Executable File

#!/bin/bash
curl localhost:8000/perf_json | jq -r '
to_entries[] as $fs |
$fs.value
| to_entries[]
| . as $func
| (
$func.value
| to_entries
| map(
(.key | gsub("[^A-Za-z0-9_]"; "_")) + "=" + (.value|tostring) + "i"
)
| join(",")
) as $fields
| "bcachefs_perf,function=\($func.key),uuid=\($fs.key) \($fields)"
'