我是Apache Nifi的新手,有以下问题:我想按如下方式转换json文件:
发件人:
{
"Property1": "x1",
"Property2": "Tag_**2ABC**",
"Property3": "x3",
"Property4": "x4"
}
{
"**2ABC**_Property1": "x1",
"**2ABC**_Property3": "x3",
"**2ABC**_Property4": "x4"
},
这意味着:从某个属性中获取值以更新所有其他属性。
到目前为止,我所做的是:我使用evaluateJSONPath处理器设置了每个属性。但我只是尝试了很多使用更新属性处理器的可能性,但没有成功。我所有可能的测试看起来像(在UpdateAttribute中):
Property1 --> ${'Property2':substring(4,6)}"_"${'Property1'}
使用震动:
[
{"operation": "modify-overwrite-beta",
"spec": {
"Property1": "${'Property2':substring(4,6)}_${'Property1'}"
}
}
]