Apache NIFi MergeContent processor - set demarcator as new line

白昼怎懂夜的黑 提交于 2019-12-18 05:08:33

问题


I want to use MergeContent processor to merge tweets to bulk insert into Elasticsearch index. For this I need command and tweets (each) to be separated by \n. This is how it should look like

{ action: { metadata }}\n
{ request body        }\n

Which will be

{ “index”}
{ tweet1 }
{ tweet2 } 

When I put \n as separator the processor actually adds \n as a string instead of new line separator. Is it possible to make it actual new line? Also is it possible to leave or make footer empty?

Thanks in advance.


回答1:


You are correct in that it takes the literal representation of what is entered. There are two ways to handle this:

  1. With delimiter strategy of 'Text': Hit shift + enter to provide a new line
  2. With delimiter strategy of 'Filename': Provide a path to a file that is only a newline character

With regards to your question on leaving the footer empty, it should work as you anticipate for the Merge Format of 'Binary Concatenation.' Making a quick test flow, I have verified this, but please let us know if it is not working for your particular configuration.



来源:https://stackoverflow.com/questions/34257508/apache-nifi-mergecontent-processor-set-demarcator-as-new-line

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