【发布时间】:2023-03-14 05:58:01
【问题描述】:
我正在尝试将大型 JSON 文档导入 Elasticsearch 5.1。一小部分数据如下所示:
[
{
"id": 1,
"region": "ca-central-1",
"eventName": "CreateRole",
"eventTime": "2016-02-04T03:41:19.000Z",
"userName": "email@group.com"
},
{
"id": 2,
"region": "ca-central-1",
"eventName": "AddRoleToInstanceProfile",
"eventTime": "2016-02-04T03:41:19.000Z",
"userName": "email@group.com"
},
{
"id": 3,
"region": "ca-central-1",
"eventName": "CreateInstanceProfile",
"eventTime": "2016-02-04T03:41:19.000Z",
"userName": "email@group.com"
},
{
"id": 4,
"region": "ca-central-1",
"eventName": "AttachGroupPolicy",
"eventTime": "2016-02-04T01:42:36.000Z",
"userName": "email@group.com"
},
{
"id": 5,
"region": "ca-central-1",
"eventName": "AttachGroupPolicy",
"eventTime": "2016-02-04T01:39:20.000Z",
"userName": "email@group.com"
}
]
如果可能的话,我想在不对源数据进行任何更改的情况下导入数据,因此我认为排除了 _bulk 命令,因为我需要为每个条目添加额外的详细信息。
我尝试了几种不同的方法,但都没有运气。我是否在浪费时间尝试按原样导入此文档?
我试过了:
curl -XPOST 'demo.ap-southeast-2.es.amazonaws.com/rea/test' --data-binary @Records.json
但是失败并出现错误:
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}},"status":400}
谢谢!
【问题讨论】:
标签: json curl elasticsearch