Nifi - 仅转换一个键后复制所有键

Nifi - Copy all the keys after transforming only one key

我想复制 json 中的所有键,但我想转换的键除外。 例如

输入JSON

{
"ts": "20200420121222",
"name": "broker",
"city": "queensland",
"age": 21,
"gender": "male"
"characteristics": {
    "Card Id": "63247354",
    "Termination Plan": "paid"
   }
}

输出JSON

{
"ts": "20200420121222",
"name": "broker",
"city": "queensland",
"age": 21,
"gender": "male"
"characteristics": {
    "card_id": "63247354",        // change here
    "termination_plan": "paid"    // change here
   }
}

有没有更好的方法可以让我只更改以下上面的键并复制其余的

您可以使用 "*": "&" 构造来包含所有其他尚未匹配的字段:

[
  {
    "operation": "shift",
    "spec": {
      "characteristics": {
        "Card Id": "characteristics.card_id",
        "Termination Plan": "characteristics.termination_plan"
      },
      "*": "&"
    }
  }
]