我使用python2.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 snapshot的json文件。在
从ES6.0Content-Type header is obligatory开始。如果您使用的是this script,那么前面提到的
elasticsearch
python库没有任何变化,因为这个脚本不使用这个库。在作为一种解决方法,您可以使用AWS elasticsearch5.6(在您弄清楚如何发送Content-Type-header之前应该是有效的)。如果您可以编辑脚本,请考虑手动设置标题(可以在here中找到一个很好的例子)。另请参见this answer。在
希望有帮助!在
相关问题 更多 >
编程相关推荐