У меня ниже код в файле JSON.
{
"comment": {
"vm-updates": [],
"site-ops-updates": [
{
"comment": {
"message": "You can start maintenance on this resource"
},
"hw-name": "Machine has got missing disks. "
}
]
},
"object_name": "4QXH862",
"has_problems": "yes",
"tags": ""
}
Я хочу отделить "hw-name" от этого файла JSON, используя jq.Я пробовал приведенные ниже комбинации, но ничего не получалось.
cat jsonfile | jq -r '.comment[].hw-name'
cat json_file.json | jq -r '.comment[].site-ops-updates[].hw-name'
Благодарим за помощь от StackOverflow !!!