Apache NIFi MergeContent 处理器 - 将分界符设置为新行 [英] Apache NIFi MergeContent processor - set demarcator as new line

查看:36
本文介绍了Apache NIFi MergeContent 处理器 - 将分界符设置为新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 MergeContent 处理器来合并推文以批量插入 Elasticsearch 索引.为此,我需要用 \n 分隔命令和推文(每个).应该是这个样子

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

什么是

{ "index"}
{ tweet1 }
{ tweet2 } 

当我将 \n 作为分隔符时,处理器实际上将 \n 添加为字符串而不是换行符.有可能使它成为真正的新线吗?也可以离开或使页脚为空吗?

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?

提前致谢.

推荐答案

您是对的,因为它采用输入内容的字面表示.有两种处理方法:

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

  1. 使用文本"分隔符策略:按 shift + enter 以提供新行
  2. 使用'文件名'的分隔符策略:提供一个只有换行符的文件路径

关于您关于将页脚留空的问题,它应该像您预期的二进制串联"的合并格式一样工作.制作一个快速测试流程,我已经验证了这一点,但如果它不适用于您的特定配置,请告诉我们.

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.

这篇关于Apache NIFi MergeContent 处理器 - 将分界符设置为新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆