PutElasticsearchJson

Description:

An Elasticsearch put processor that uses the official Elastic REST client libraries.

Additional Details...

Tags:

json, elasticsearch, elasticsearch5, elasticsearch6, elasticsearch7, elasticsearch8, put, index

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Identifier Attributeput-es-json-id-attrThe name of the FlowFile attribute containing the identifier for the document. If the Index Operation is "index", this property may be left empty or evaluate to an empty value, in which case the document's identifier will be auto-generated by Elasticsearch. For all other Index Operations, the attribute must evaluate to a non-empty value.
Index Operationput-es-record-index-opindexThe type of the operation used to index (create, delete, index, update, upsert)
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Indexel-rest-fetch-indexThe name of the index to use.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Typeel-rest-typeThe type of this document (used by Elasticsearch for indexing and searching).
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Batch Sizeput-es-record-batch-size100The preferred number of FlowFiles to send over in a single batch.
Supports Expression Language: true (will be evaluated using variable registry only)
Character Setput-es-json-charsetUTF-8Specifies the character set of the document data.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Client Serviceel-rest-client-serviceController Service API:
ElasticSearchClientService
Implementation: ElasticSearchClientServiceImpl
An Elasticsearch client service to use for running queries.
Log Error Responsesput-es-record-log-error-responsesfalse
  • true
  • false
If this is enabled, errors will be logged to the NiFi logs at the error log level. Otherwise, they will only be logged if debug logging is enabled on NiFi as a whole. The purpose of this option is to give the user the ability to debug failed operations without having to turn on debug logging.
Output Error Documentsput-es-json-error-documentsfalse
  • true
  • false
If this configuration property is true, the response from Elasticsearch will be examined for failed documents and the FlowFile(s) associated with the failed document(s) will be sent to the "errors" relationship.
Treat "Not Found" as Errorput-es-json-not_found-is-errortrue
  • true
  • false
If true, "not_found" Elasticsearch Document associated FlowFiles will be routed to the "success" relationship, otherwise to the "errors" relationship.

This Property is only considered if the [Output Error Documents] Property has a value of "true".

Dynamic Properties:

Supports Sensitive Dynamic Properties: No

Dynamic Properties allow the user to specify both the name and value of a property.

NameValueDescription
The name of a URL query parameter to addThe value of the URL query parameterAdds the specified property name/value as a query parameter in the Elasticsearch URL used for processing. These parameters will override any matching parameters in the _bulk request body. If FlowFiles are batched, only the first FlowFile in the batch is used to evaluate property values.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

Relationships:

NameDescription
retryAll flowfiles that fail due to server/cluster availability go to this relationship.
successAll flowfiles that succeed in being transferred into Elasticsearch go here. Documents received by the Elasticsearch _bulk API may still result in errors on the Elasticsearch side. The Elasticsearch response will need to be examined to determine whether any Document(s)/Record(s) resulted in errors.
failureAll flowfiles that fail for reasons unrelated to server availability go to this relationship.
errorsIf a "Output Error Documents" is set, any FlowFile(s) corresponding to Elasticsearch document(s) that resulted in an "error" (within Elasticsearch) will be routed here.

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
elasticsearch.put.errorThe error message provided by Elasticsearch if there is an error indexing the document.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

ResourceDescription
MEMORYThe Batch of FlowFiles will be stored in memory until the bulk operation is performed.