$ cat /tmp/test.json
{
"foo": 0,
"bar": 100
}
$ cat /tmp/test.json | jq -r '. | to_entries | map("\(.key)\t\(.value)") | join("\n")'
foo 0
bar 100
$ cat /tmp/test.json | jq --arg epoch $(date +%s) -r '. | to_entries | map("\(.key)\t\(.value)\t\($epoch)") | join("\n")'
foo 0 1479362640
bar 100 1479362640
Last active
November 17, 2016 06:04
-
-
Save tkuchiki/f19d9af126cb5061f4f7cc4185cd2eab to your computer and use it in GitHub Desktop.
json を mackerel plugin の出力形式に変換
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment