【发布时间】:2019-12-17 22:19:26
【问题描述】:
我有下面的 json 文件,我想在 NIFI 中拆分它
输入:
[ {
"id" : 123,
"ticket_id" : 345,
"events" : [ {
"id" : 3322,
"type" : "xyz"
}, {
"id" : 6675,
"type" : "abc",
"value" : "sample value",
"field_name" : "subject"
}, {
"id" : 9988,
"type" : "abc",
"value" : [ "text_file", "json_file" ],
"field_name" : "tags"
}]
}]
我的输出应该是 3 个不同的 json,如下所示:
{
"id" : 123,
"ticket_id" : 345,
"events.id" :3322,
"events.type":xyz
}
{
"id" : 123,
"ticket_id" : 345,
"events.id" :6675,
"events.type":"abc",
"events.value": "sample value"
"events.field_name":"subject"
}
{
"id" : 123,
"ticket_id" : 345,
"events.id" :9988,
"events.type":"abc",
"events.value": "[ "text_file", "json_file" ]"
"events.field_name":"tags"
}
我想知道我们可以使用 splitjson 吗?我的意思是 splitjson 可以根据 json 中存在的 json 对象数组拆分 json 吗?
如果有办法实现这一点,请告诉我。
【问题讨论】:
标签: json apache-nifi