Skip to content

Jq syntax

filter to only one key of a json web response

Response from curl request

curl http://localhost:81/debug
{
  "response": {
    "Expression": "2+2",
    "Signature": "63b9507a01c14d9b13eebb0af4c1c0042417662b0f38cda4b35a7b6c2b53ef9261b447f5bcd01be64c2db680b80af2424edcfc8feb5aa53c3f5be16aefbf91ed37d1603beb1c62d96f84f86049c85817395ac9cc71fc7fdec98176c5a30938bc"
  }
}

To get only the "signature":

curl -s http://localhost:81/debug|jq '.response.Signature'
"81a6de30aab520f5588893222900f871f06a8be8b2091a1f151957eb423553274afb9530c14d37205dce12117f86a867f0f56822d1dfe63c981b737a79be42011fb3947f3f93dbcf020d2671806686113dc96ad0bd9d747ad6bb906daf97f0af"

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