Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-10687

PutElasticsearchRecord/Json incorrectly try to use empty String as document _id

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.18.0
    • 1.19.0
    • None
    • None

    Description

      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)

      Attachments

        Issue Links

          Activity

            People

              Chris S Chris Sampson
              Chris S Chris Sampson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m