Hi All,
Our required in-built module gives huge output of different keys that have multiple values with objects. I used 'with_dict' and when to narrow and get desired output as below. Here also am facing a road block that how can I get the element where any value doesn't meet. How can get output of the block when "status": "CRITICAL" instead of all.
Output:
"msg": {
"key": "devices",
"value": [
{
"configuration": "Configured",
"version": "PD-0.7",
"label": "device-1",
"location": "1",
"serial_number": "PWH12GVF",
"status": "OK"
},
{
"configuration": "Configured",
"version": "PD-0.7",
"label": "device-2",
"location": "2",
"serial_number": "PWH12GWF",
"status": "OK"
},
{
"configuration": "Configured",
"version": "PD-0.7",
"label": "device-3",
"location": "3",
"serial_number": "PWH12GXF",
"status": "CRITICAL"
}
]
}
Desired output:
"configuration": "Configured",
version": "PD-0.7",
"label": "device-3",
"location": "3",
"serial_number": "PWH12GXF",
"status": "CRITICAL"