PutElasticsearchHttpRecord

Deprecation notice:

This processor is deprecated and may be removed in future releases.

Please consider using one the following alternatives: PutElasticsearchRecord

Description:

Writes the records from a FlowFile into to Elasticsearch, using the specified parameters such as the index to insert into and the type of the document, as well as the operation type (index, upsert, delete, etc.). Note: The Bulk API is used to send the records. This means that the entire contents of the incoming flow file are read into memory, and each record is transformed into a JSON document which is added to a single HTTP request body. For very large flow files (files with a large number of records, e.g.), this could cause memory usage issues.

Tags:

elasticsearch, insert, update, upsert, delete, write, put, http, record

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
Elasticsearch URLelasticsearch-http-urlElasticsearch URL which will be connected to, including scheme (http, e.g.), host, and port. The default port for the REST API is 9200.
Supports Expression Language: true (will be evaluated using variable registry only)
SSL Context ServiceSSL Context ServiceController Service API:
SSLContextService
Implementations: StandardSSLContextService
StandardRestrictedSSLContextService
The SSL Context Service used to provide client certificate information for TLS/SSL connections. This service only applies if the Elasticsearch endpoint(s) have been secured with TLS/SSL.
Character SetCharacter SetUTF-8Specifies the character set of the document data.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
UsernameUsernameUsername to access the Elasticsearch cluster
Supports Expression Language: true (will be evaluated using variable registry only)
PasswordPasswordPassword to access the Elasticsearch cluster
Sensitive Property: true
Supports Expression Language: true (will be evaluated using variable registry only)
Connection Timeoutelasticsearch-http-connect-timeout5 secsMax wait time for the connection to the Elasticsearch REST API.
Supports Expression Language: true (will be evaluated using variable registry only)
Response Timeoutelasticsearch-http-response-timeout15 secsMax wait time for a response from the Elasticsearch REST API.
Supports Expression Language: true (will be evaluated using variable registry only)
Proxy Configuration Serviceproxy-configuration-serviceController Service API:
ProxyConfigurationService
Implementation: StandardProxyConfigurationService
Specifies the Proxy Configuration Controller Service to proxy network requests. If set, it supersedes proxy settings configured per component. Supported proxies: HTTP + AuthN, SOCKS In case of SOCKS, it is not guaranteed that the selected SOCKS Version will be used by the processor.
Proxy Hostelasticsearch-http-proxy-hostThe fully qualified hostname or IP address of the proxy server
Supports Expression Language: true (will be evaluated using variable registry only)
Proxy Portelasticsearch-http-proxy-portThe port of the proxy server
Supports Expression Language: true (will be evaluated using variable registry only)
Proxy Usernameproxy-usernameProxy Username
Supports Expression Language: true (will be evaluated using variable registry only)
Proxy Passwordproxy-passwordProxy Password
Sensitive Property: true
Supports Expression Language: true (will be evaluated using variable registry only)
Record Readerput-es-record-record-readerController Service API:
RecordReaderFactory
Implementations: GrokReader
JsonTreeReader
WindowsEventLogReader
ReaderLookup
ParquetReader
CSVReader
Syslog5424Reader
ExcelReader
CEFReader
XMLReader
ScriptedReader
SyslogReader
JsonPathReader
AvroReader
YamlTreeReader
Specifies the Controller Service to use for parsing incoming data and determining the data's schema.
Record Writerput-es-record-record-writerController Service API:
RecordSetWriterFactory
Implementations: FreeFormTextRecordSetWriter
CSVRecordSetWriter
ParquetRecordSetWriter
RecordSetWriterLookup
ScriptedRecordSetWriter
XMLRecordSetWriter
JsonRecordSetWriter
AvroRecordSetWriter
After sending a batch of records, Elasticsearch will report if individual records failed to insert. As an example, this can happen if the record doesn't match the mappingfor the index it is being inserted into. This property specifies the Controller Service to use for writing out those individual records sent to 'failure'. If this is not set, then the whole FlowFile will be routed to failure (including any records which may have been inserted successfully). Note that this will only be used if Elasticsearch reports that individual records failed and that in the event that the entire FlowFile fails (e.g. in the event ES is down), the FF will be routed to failure without being interpreted by this record writer. If there is an error while attempting to route the failures, the entire FlowFile will be routed to Failure. Also if every record failed individually, the entire FlowFile will be routed to Failure without being parsed by the writer.
Log all errors in batchput-es-record-log-all-errorsfalse
  • true
  • false
After sending a batch of records, Elasticsearch will report if individual records failed to insert. As an example, this can happen if the record doesn't match the mapping for the index it is being inserted into. If this is set to true, the processor will log the failure reason for the every failed record. When set to false only the first error in the batch will be logged.
Identifier Record Pathput-es-record-id-pathA RecordPath pointing to a field in the record(s) that contains the identifier for the document. If the Index Operation is "index" or "create", 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 field's value must be non-empty.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
@timestamp Record Pathput-es-record-at-timestamp-pathA RecordPath pointing to a field in the record(s) that contains the @timestamp for the document. If left blank the @timestamp will be determined using the main @timestamp property
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
@timestamp Valueput-es-record-at-timestampThe value to use as the @timestamp field (required for Elasticsearch Data Streams)
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Indexput-es-record-indexThe name of the index to insert into
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Typeput-es-record-typeThe type of this document (required by Elasticsearch versions < 7.0 for indexing and searching). This must be unset or '_doc' for Elasticsearch 7.0+.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Index Operationput-es-record-index-opindexThe type of the operation used to index (create, index, update, upsert, delete)
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Suppress Null Valuessuppress-nullsNever Suppress
  • Never Suppress Fields that are missing (present in the schema but not in the record), or that have a value of null, will be written out as a null value
  • Always Suppress Fields that are missing (present in the schema but not in the record), or that have a value of null, will not be written out
  • Suppress Missing Values When a field has a value of null, it will be written out. However, if a field is defined in the schema and not present in the record, the field will not be written out.
Specifies how the writer should handle a null field
Date FormatDate FormatSpecifies the format to use when reading/writing Date fields. If not specified, the default format 'yyyy-MM-dd' is used. If specified, the value must match the Java Simple Date Format (for example, MM/dd/yyyy for a two-digit month, followed by a two-digit day, followed by a four-digit year, all separated by '/' characters, as in 01/25/2017).
Supports Expression Language: true (will be evaluated using variable registry only)
Time FormatTime FormatSpecifies the format to use when reading/writing Time fields. If not specified, the default format 'HH:mm:ss' is used. If specified, the value must match the Java Simple Date Format (for example, HH:mm:ss for a two-digit hour in 24-hour format, followed by a two-digit minute, followed by a two-digit second, all separated by ':' characters, as in 18:04:15).
Supports Expression Language: true (will be evaluated using variable registry only)
Timestamp FormatTimestamp FormatSpecifies the format to use when reading/writing Timestamp fields. If not specified, the default format 'yyyy-MM-dd HH:mm:ss' is used. If specified, the value must match the Java Simple Date Format (for example, MM/dd/yyyy HH:mm:ss for a two-digit month, followed by a two-digit day, followed by a four-digit year, all separated by '/' characters; and then followed by a two-digit hour in 24-hour format, followed by a two-digit minute, followed by a two-digit second, all separated by ':' characters, as in 01/25/2017 18:04:15).
Supports Expression Language: true (will be evaluated using variable registry only)

Dynamic Properties:

Supports Sensitive Dynamic Properties: No

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

NameValueDescription
A URL query parameterThe value to set it toAdds the specified property name/value as a query parameter in the Elasticsearch URL used for processing
Supports Expression Language: true (will be evaluated using variable registry only)

Relationships:

NameDescription
retryA FlowFile is routed to this relationship if the database cannot be updated but attempting the operation again may succeed
successAll FlowFiles that are written to Elasticsearch are routed to this relationship
failureAll FlowFiles that cannot be written to Elasticsearch are routed to this relationship

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
record.countThe number of records in an outgoing FlowFile. This is only populated on the 'success' relationship.
failure.countThe number of records found by Elasticsearch to have errors. This is only populated on the 'failure' relationship.

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:

None specified.