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

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

问题描述

我想使用MergeContent处理器将tweets合并到批量插入到Elasticsearch索引中。为此,我需要命令和tweets(each)由\\\
分隔。
这是它应该如
{action:{metadata}} \\\

{request body} \\\

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} \\\

Which will be { "index" )\n { tweet1 }\n { tweet2 }\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 +输入以提供新行

  2. 使用'Filename'的分隔符策略:提供只有换行符的文件的路径

关于你离开页脚的问题是空的,它应该像你预期的二进制连接的合并格式一样工作。做一个快速的测试流程,我已经验证了这一点,但是如果它不适用于您的特定配置。

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天全站免登陆