I have a json output
{
"code": 200,
"success": true,
"data": [{
"id": "66",
"subnet": "0.0.0.0",
"mask": "",
"sectionId": "1",
"description": "THA4",
},
{
"id": "72",
"subnet": "1.2.3.4",
"mask": "",
"sectionId": "1",
"description": "ALF5",
},
],
}
I'd like to have the output like this based on the description and subnet:
THA4
0.0.0.0
ALF5
1.2.3.4
and want to have like this too:
THA4,0.0.0.0
ALF5,1.2.3.4
With my query:
jq '.data | .[].description,.[].subnet'
I can get only like this:
0.0.0.0
1.2.3.4
THA4
ALF5