You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "David Vassallo (Jira)" <ji...@apache.org> on 2022/12/05 15:37:00 UTC

[jira] [Created] (NIFI-10948) QueryElasticsearchHTTP doesnt work on Opensearch (and possibly newer Elasticsearch versions)

David Vassallo created NIFI-10948:
-------------------------------------

             Summary: QueryElasticsearchHTTP doesnt work on Opensearch (and possibly newer Elasticsearch versions)
                 Key: NIFI-10948
                 URL: https://issues.apache.org/jira/browse/NIFI-10948
             Project: Apache NiFi
          Issue Type: Bug
          Components: Extensions
    Affects Versions: 1.15.3
         Environment: Nifi 1.15.3 on centos machine
            Reporter: David Vassallo
         Attachments: image-2022-12-05-16-34-20-513.png

The QueryElasticsearchHTTP processor will return a "Null Pointer Exception" when running agasint Opensearch and probably newer versions of Elasticsearch. I tracked down the null pointer to this line:

 

[https://github.com/apache/nifi/blob/0ebc6d31489e975dcbbe078fa572332ef8ffa9e2/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/QueryElasticsearchHttp.java#L418]

 

The processor is looking for the "_type" field which is no longer in the right place. In opensearch v 1.x and above (possibly Elasticsearch too, but I dont have the means to test this), the field has moved to be a child of the "@metadata" field:

!image-2022-12-05-16-34-20-513.png!

 

If you try to circumvent this issue by populating the "Type" property of the processor, you will get an HTTP 400 Bad Message response since the processor builds a URL with the "size" and "from" arguments as part of the URL which are not supported by Opensearch/Elasticsearch in more recent versions, so you are forced to leave this property empty but then run into the null problem described above



--
This message was sent by Atlassian Jira
(v8.20.10#820010)