Consider eg.json:

{
  "Records": [
    {
      "Sns": {
        "Message": ""
      }
    }
  ]
}

Embed a JSON string in to the Message

jq --argfile file eg.json '.Records[0].Sns.Message = ($file | tojson)' eg.json

Extract a JSON stringified into the Message

jq --argfile file eg.json '.Records[0].Sns.Message = ($file | tojson)' eg.json |
jq '.Records[0].Sns.Message|fromjson'
Feedback

Powered by Vanilla PHP feedback form