I tried using Parse JSON to array in a shell script
but unable to get required field. Below is my json:
{
"status": "UP",
"databaseHealthCheck":
{
"status": "UP",
"dataSource":
{
"maxActive": 100,
"maxIdle": 8,
"numActive": 0,
"url": "jdbc:oracle:thin:@hostname:port/db_name",
"userName": "test_123"
}
},
"JMSHealthCheck":
{
"status": "UP",
"producerTemplate":
{
"name": "Test_2",
"pendingCount": 0,
"operator": "<"
}
},
"diskSpace":
{
"status": "UP",
"total": 414302519296,
"free": 16099868672,
"threshold": 10485760
}
}
I want to extract pendingCount value under producerTemplate under JMSHealthCheck.
Have restriction to use utility like jq.
Bash Version 3.x