Chris Sampson created NIFI-10687:
------------------------------------
Summary: PutElasticsearchRecord/Json incorrectly try to use empty
String as document _id
Key: NIFI-10687
URL: https://issues.apache.org/jira/browse/NIFI-10687
Project: Apache NiFi
Issue Type: Bug
Affects Versions: 1.18.0
Reporter: Chris Sampson
{{PutElasticsearchRecord}} and {{PutElasticsearchJson}} will try to pass an
empty/blank String as the {{_id}} of the document to be created in
Elasticsearch if the processor is, for example, configured to use an attribute
from the FlowFile or a field from the Record that doesn't exist.
To re-create:
* set the ID field to point at a non-existent Field using Expression Language,
e.g. {{${notExist}}}
* input a FlowFile where the attribute/Record Path equates to a non-existent
Field (i.e. returns an empty String, but not {{null}})
* observe that the attempt to send a document to Elasticsearch uses the empty
String rather than {{null}}
Setting the {{_id}} in NiFi to {{null}} in such circumstances would be
preferable/expected as this would cause Elasticsearch to auto-generate an
{{_id}} when indexing.
Other NiFi processor fields may also be affected, e.g. for {{@timestamp}}
(others should be considered, but some fields should legitimately equate to an
empty/blank String and cause an error - {{index}}, for example)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)