Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to extract multiple values from json object using jq command

Tags:

json

jq

I am trying to get multiple values from a json object.

{
    "nextToken": "9i2x1mbCpfo5hQ",
    "jobSummaryList": [
        {
            "jobName": "012210",
            "jobId": "0196f81cae73"
        }
    ]
}

I want nextToken's value and jobName in one jq command.

like image 591
Anjali Avatar asked Oct 25 '25 15:10

Anjali


1 Answers

https://stedolan.github.io/jq/manual/

jq '.nextToken, .jobSummaryList[].jobName' file
like image 156
Anna Semjén Avatar answered Oct 28 '25 03:10

Anna Semjén



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!