es批量操作_bulk
curl -XPOST 'localhost:9200/_bulk?pretty' --data-binary ../@data.json
当执行上面的语句,报错如下:
{
"error" : {
"root_cause" : [ {
"type" : "parse_exception",
"reason" : "Failed to derive xcontent"
} ],
"type" : "parse_exception",
"reason" : "Failed to derive xcontent"
},
"status" : 400
}
原因:@放在路径的前面
相对路径:
curl -XPOST 'localhost:9200/bank/_bulk?pretty' --data-binary @../data.json
绝对路径:
curl -H "Content-Type: application/json" -XPOST "localhost:9200/bank/_bulk?pretty&refresh" --data-binary @D:\elasticsearch-plugin\data.json
本文介绍使用curl命令通过ELK批量导入数据时遇到的问题及解决方法。主要关注于如何正确指定JSON文件路径,并展示了正确的相对路径与绝对路径写法。
2172

被折叠的 条评论
为什么被折叠?



