One of the many thousand json blocks in an array of json blocks looks as follows -
{
"id": 4409976,
"name": "MKLIU",
"version": "1.0",
"package_type": "generic",
"status": "default",
"_links": {
"web_path": "/part1/part2/ONEMTH/part4/-/part5/part6",
"delete_api_path": "https://example.com/api/v1/part40/part90/part65/part73"
},
"created_at": "2019-01-02T10:52:34.857Z",
"project_id": 667845,
"project_path": "hereitis/downloads/ONEMTH/MKLIU",
"tags": []
}
I am looking to parse the array of json blocks on Ubuntu command line using jq utility
Expected output
667845#MKLIU#ONEMTH
The code I've written so far is as below
curl <some url> | jq -r '.[] | [.project_id, .name, ._links.web_path] | join("#")'
I can't work out how to pull out just the part ONEMTH from ._links.web_path
Could use project_path field too from the json block to parse out the value.
Please could I request some guidance ?