Anjali
Anjali

Reputation: 41

how to extract multiple values from json object using jq command

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.

Upvotes: 4

Views: 5016

Answers (1)

Anna Semjén
Anna Semjén

Reputation: 787

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

jq '.nextToken, .jobSummaryList[].jobName' file

Upvotes: 3

Related Questions