我正在使用python 2.7在AWS Elasticsearch (v6.3)中摄取数据,同时添加数据(Json)
response: {"error":"Content-Type header is missing","status":406}...message: {"error":"Content-Type header is missing","status":406}我已经用pip install elasticsearch安装了最新的elasticsearch lib。
我正在摄取AWS Config快照的json文件。
发布于 2018-08-21 03:53:10
从ES 6.0 Content-Type header is obligatory开始。如果您使用的是this script,那么前面提到的elasticsearch python库不会有任何变化,因为这个脚本不使用这个库。
作为一种变通办法,您可以使用AWS Elasticsearch 5.6 (在您弄清楚如何发送Content-Type报头之前,应该一直有效)。如果您可以编辑该脚本,请考虑手动设置标头(here就是一个很好的例子)。另请参阅this answer。
希望这能有所帮助!
https://stackoverflow.com/questions/51937169
复制相似问题