am trying to write a shell script where I need to read a json data, and according to the status = 'SUCCESS', I need to fetch the id of that array. So basically i need to loop through the list of array, and check in each whether status ='SUCCESS', if true then get the id and break
sample json:
[
{
"id": “id_1",
"name": "INSIGHTS_METRICS",
"type": "INSIGHTS_METRICS",
"startTime": 1589354439897,
"endTime": 0,
"timeTaken": 0,
"inputFiles": null,
"outputFiles": null,
"status": “FAIL",
"statusMessage": null,
"subCode": null,
"location": null,
"externalId": null,
"parentId": null,
"childJobs": null
},
{
"id": “id_2",
"name": "INSIGHTS_METRICS",
"type": "INSIGHTS_METRICS",
"startTime": 1589348936383,
"endTime": 0,
"timeTaken": 0,
"inputFiles": null,
"outputFiles": null,
"status": "RUNNING",
"statusMessage": null,
"subCode": null,
"location": null,
"externalId": null,
"parentId": null,
"childJobs": null
},
{
"id": "id_3",
"name": "INSIGHTS_METRICS",
"type": "INSIGHTS_METRICS",
"startTime": 1589348677458,
"endTime": 0,
"timeTaken": 0,
"inputFiles": null,
"outputFiles": null,
"status": “SUCCESS",
"statusMessage": null,
"subCode": null,
"location": null,
"externalId": null,
"parentId": null,
"childJobs": null
},