jq
を使用してJSONファイルを解析しています。jqを使用して既存のファイルにjsonのセクションを追加する方法
{
"Value": {
"Ref": "TEAM"
},
"PropagateAtLaunch": true,
"Key": "TEAM"
}
がどのように私は、この新しいセクションを追加することができます。私は私のような別のセクションを追加したい。この中の含有量以下
[
{
"PropagateAtLaunch": true,
"Value": {
"Ref": "TNAM"
},
"Key": "Name"
},
{
"PropagateAtLaunch": true,
"Value": {
"Ref": "TAPP"
},
"Key": "application"
},
{
"PropagateAtLaunch": true,
"Value": {
"Ref": "TENV"
},
"Key": "environment"
},
{
"PropagateAtLaunch": true,
"Value": {
"Ref": "TSHA"
},
"Key": "shared"
},
{
"PropagateAtLaunch": true,
"Value": {
"Ref": "TTER"
},
"Key": "tier"
},
{
"PropagateAtLaunch": true,
"Value": {
"Ref": "CostCenter"
},
"Key": "cost-center"
}
]
とJSONファイルのいくつかのセクションがありますか?
これは私が最初のセクションを抽出するために使用しているクエリです:
$ cat ABC.json | jq '.Resources.ASGRP.Properties.Tags'
サンティアゴありがとうございます。これは別のユースケースの実装にも役立ちました。 –