【发布时间】:2017-06-22 15:58:09
【问题描述】:
我想用从其他处理器获得的值更新 JSON 文件中的属性。以下是我的原始 JSON 文件。
{
"applicant": {
"applicant-id": null
"full-name": "Tyrion Lannister",
"mobile-number" : "8435739739",
"email-id" : "tyrionlannister_casterlyrock@gmail.com"
},
"product": {
"product-category" : "Credit Card",
"product-type" : "Super Value Card - Titanium"
}
}
下面是我的 EvaluavateJsonPath 配置,我在其中提取了 applicant-id 属性。
下面是我的 GenerateFlowFile 处理器,它生成一个 id 值。
现在我需要使用原始 JSON 中的值 (899872120) 更新 applicant-id 属性,如下所示。
{
"applicant": {
"applicant-id": 899872120
"full-name": "Tyrion Lannister",
"mobile-number" : "8435739739",
"email-id" : "tyrionlannister_casterlyrock@gmail.com"
},
"product": {
"product-category" : "Credit Card",
"product-type" : "Super Value Card - Titanium"
}
}
我尝试使用 MergeContent 来合并 2 个流,我可以在 MergeContent 处理器之后的流文件中看到 Applicant-Id 属性值。我尝试使用 UpdateAttribue 更新 Applicant-Id 但我无法获取更新 JSON 记录。
下面是我的 MergeContent 配置。
我有什么遗漏的吗?
【问题讨论】:
标签: json apache-nifi