PutElasticsearchJson 2025.10.9.21

捆绑包

org.apache.nifi | nifi-elasticsearch-restapi-nar

描述

使用官方 Elastic REST 客户端库的 Elasticsearch 放置处理器。每个 FlowFile 都被视为要发送到 Elasticsearch _bulk API 的文档。可以将多个 FlowFiles 批处理到每个发送到 Elasticsearch 的请求。

标签

elasticsearch, elasticsearch7, elasticsearch8, elasticsearch9, index, json, put

输入要求

REQUIRED

支持敏感的动态属性

false

属性

属性

描述

批处理大小

单批发送的 FlowFiles 的首选数量

字符集

指定文档数据的字符集。

Client Service

用于运行查询的 Elasticsearch 客户端服务。

Dynamic Templates

文档的 dynamic_templates。必须可以解析为 JSON 对象。需要 Elasticsearch 7+

标识符属性

包含文档标识符的 FlowFile 属性的名称。如果索引操作为“index”,则此属性可能会留空或计算为空值,在这种情况下,文档的标识符将由 Elasticsearch 自动生成。对于所有其他索引操作,此属性的计算结果必须为非空值。

索引

要使用的索引的名称。

索引操作

用于索引的操作的类型(创建、删除、索引、更新、更新插入)

Log Error Responses

如果启用了此属性,则将在错误日志级别将错误记录到 NiFi 日志中。否则,只有在 NiFi 上整体启用调试日志记录时,才会记录错误。此选项的目的是,使用户能够在不必打开调试日志记录的情况下调试失败的操作。

最大 JSON 字段字符串长度

解析 JSON 文档或属性时字符串值的最大允许长度。

Output Error Responses

If this is enabled, response messages from Elasticsearch marked as "error" will be output to the "error_responses" relationship. This does not impact the output of flowfiles to the "successful" or "errors" relationships

Script

文档更新/更新插入的脚本。仅适用于更新/更新插入操作。必须可以解析为 JSON 对象。如果留空,则 FlowFile 内容将用于文档更新/更新插入

Scripted Upsert

Whether to add the scripted_upsert flag to the Upsert Operation. If true, forces Elasticsearch to execute the Script whether or not the document exists, defaults to false. If the Upsert Document provided (from FlowFile content) will be empty, but sure to set the Client Service controller service's Suppress Null and Empty Values to Never Suppress or no "upsert" doc will be, included in the request to Elasticsearch and the operation will not create a new document for the script to execute against, resulting in a "not_found" error

未找到时视为成功

如果为 true,“not_found”Elasticsearch 文档关联记录将路由到“successful”关系,否则将路由到“errors”关系。如果输出错误响应为“true”,则来自 Elasticsearch 的“not_found”响应将发送到 error_responses 关系。

类型

此文档的类型(由 Elasticsearch 用于建立索引和执行搜索)。

关系

名称

描述

errors

与导致“error”(在 Elasticsearch 中)的 Elasticsearch 文档对应的记录/FlowFile 将路由到此处。

failure

所有因与服务器可用性无关的原因而失败的 FlowFile 都将转到此关系。

original

在没有请求失败的情况下发送到 Elasticsearch 的所有 FlowFile 都将转到此关系。

retry

所有因服务器/集群可用性而失败的 Flowfile 都将转到此关系。

successful

与未导致“error”(在 Elasticsearch 中)的 Elasticsearch 文档对应的记录/FlowFile 将路由到此处。

写入属性

名称

描述

elasticsearch.put.error

如果在解析 FlowFile、将已解析的文档发送到 Elasticsearch 或解析 Elasticsearch 响应时出现问题,则显示此错误消息

elasticsearch.bulk.error

如果在 Elasticsearch 中处理文档时出现错误,则返回此 _bulk 响应。

另请参阅

语言: 中文