You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use pcp2elasticsearch-5.2.5 to send PCP logs to an Elasticsearch-8.12.2 instance. However, trying to run it out of the box fails to upload anything to Elasticsearch but does not show any errors. Editing the source code for this program to add a few debugging print statements shows that a POST request is being made to /pcp/pcp-metric. Using cURL to send a POST request constructed the same way gives back an error:
$ curl -i -X POST <es-server>/pcp/pcp-metric
HTTP/1.1 400 Bad Request
X-elastic-product: Elasticsearch
content-type: application/json
content-length: 72
{"error":"no handler found for uri [/pcp/pcp-metric] and method [POST]"}
I could not find anything in the Elasticsearch API reference about an endpoint of the form /{index}/{type}, which is what this seems to be based on the .py source code. However, the API reference for Elasticsearch version 6.x and older shows that this was the correct endpoint to insert a document into an index. The reference page for 8.x (current) Elasticsearch lists a new endpoint along with the link removal of mapping types, which explains that mapping types were slated to be removed in 5.x and have been phased out until their full removal in 8.x. However, pcp2elasticsearch seems to still rely on them.
Sending a cURL POST request to the current endpoint works as expected:
$ curl -i -X POST <es-server>/pcp/_doc
HTTP/1.1 201 Created
Location: /pcp/_doc/Q21s9I8BuerNNLwI2fY5
X-elastic-product: Elasticsearch
content-type: application/json
content-length: 158
{"_index":"pcp","_id":"Q21s9I8BuerNNLwI2fY5","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":4329,"_primary_term":1}
Changing the pcp2elasticsearch source code to use this updated endpoint also seems to fix the program, but the logic of it may rely on mapping types more deeply - I didn't spend very much time looking at it.
I am aware that there are more recent versions of PCP than 5.2.5 available which have updates to pcp2elasticsearch; however, these updates fix other problems. The current source code at pcp/src/pcp2elasticsearch/pcp2elasticsearch.py still uses the removed endpoint.
The text was updated successfully, but these errors were encountered:
I am trying to use pcp2elasticsearch-5.2.5 to send PCP logs to an Elasticsearch-8.12.2 instance. However, trying to run it out of the box fails to upload anything to Elasticsearch but does not show any errors. Editing the source code for this program to add a few debugging print statements shows that a POST request is being made to /pcp/pcp-metric. Using cURL to send a POST request constructed the same way gives back an error:
I could not find anything in the Elasticsearch API reference about an endpoint of the form /{index}/{type}, which is what this seems to be based on the .py source code. However, the API reference for Elasticsearch version 6.x and older shows that this was the correct endpoint to insert a document into an index. The reference page for 8.x (current) Elasticsearch lists a new endpoint along with the link removal of mapping types, which explains that mapping types were slated to be removed in 5.x and have been phased out until their full removal in 8.x. However, pcp2elasticsearch seems to still rely on them.
Sending a cURL POST request to the current endpoint works as expected:
Changing the pcp2elasticsearch source code to use this updated endpoint also seems to fix the program, but the logic of it may rely on mapping types more deeply - I didn't spend very much time looking at it.
I am aware that there are more recent versions of PCP than 5.2.5 available which have updates to pcp2elasticsearch; however, these updates fix other problems. The current source code at pcp/src/pcp2elasticsearch/pcp2elasticsearch.py still uses the removed endpoint.
The text was updated successfully, but these errors were encountered: