Given the json filter.json
:
{
"123": {
"name": "Horst"
},
"789": {
"name": "Bob"
}
}
I want to filter for each key and the name, wanting an output like:
"123": "Horst"
"789": "Bob"
I tried:
jq .[].name,keys < filter.json
Yet it gives me faulty output of:
"Horst"
"Bob"
[
"123",
"789"
]
yet I don't know how to "merge" these two outputs to one. Where am I going wrong?