skip to Main Content

Json – jq filtering on specific key and collating values into single csv cell

Given this json: {"data": [ { "account_id": "123", "account_status": "active", "name": "john doe", "email": "[email protected]", "product_access": [] }, { "account_id": "345", "account_status": "active", "name": "jane doe", "email": "[email protected]", "last_active": "2023-08-23T13:03:27.811473590Z", "product_access": [ { "name": "Product 1", "key": "product1", "url": "acme1.com"…

VIEW QUESTION

Json – Group and Sum value with JQ

I've got a file with these jsons: {"count":42,"day":"2023-06-22","id":"123"} {"count":12,"day":"2023-06-22","id":"456"} {"count":23,"day":"2023-06-23","id":"123"} {"count":44,"day":"2023-06-23","id":"789"} {"count":65,"day":"2023-06-21","id":"456"} Actually I don't care about the day and want to group my records by id and sum the count. Expected result: {"id":"123","count":65} {"id":"456","count":77} {"id":"789","count":44} How would I achieve…

VIEW QUESTION
Back To Top
Search