{
"status": "DOWN",
"components": {
"ping": {
"status": "UP",
"details": {
"version": "1.0.0",
"description": "dobre application",
"name": "SO-3113"
}
},
"bridge.lock": {
"status": "UP",
"details": {
"description": "test1"
}
},
"Configuration converted": {
"status": "DOWN",
"details": {
"description": "test2"
}
},
"app started": {
"status": "DOWN",
"details": {
"description": "test3"
}
}
}
}
I need to get the name of first component with DOWN status ("Configuration converted" in above json). So far i managed to get only .details.description
of it:
jq -c '.components| .[] | select( .status | contains("DOWN")) .details.description' | head -1
How can I get the name (key) of component? ("Configuration converted")