nifi ConvertRecord JSON to CSV getting only single record?

自古美人都是妖i 提交于 2019-12-03 10:15:03

You are facing this NIFI-4456 bug and has been fixed starting from NiFi-1.7 version.

To work around this issue:

1.use SplitText processor with split line count =1

2.Then use MergeContent/MergeRecord processors (using Defragments as merge strategy) and make as valid json array of messages

if you are using Merge Record processor then Reader and Writer controller services needs to be in Json format.

3.Then feed the merged relation to ConvertRecord processor.

Flow:

Starting from NiFi-1.7+ version, we don't need to configure any thing new/additional in JsonTreeReader controller service as NiFi is able to read json per line format also.

Update:

MergeContent Configs:

if we are using MergeContent processor please configure the processor like this way as shown in the below screenshot.

Delimiter Strategy Text

Header [

Footer ]

Demarcator ,

In addition i would suggest to use MergeRecord processor instead of MergeContent processor which will take care of creating a valid array of json messages.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!