我最近将我的 ElasticStack 实例从 5.5 升级到 6.0,这个版本的一些重大变化似乎损害了我的管道。我有一个脚本,它根据 ElasticSearch 中的索引自动为一些相似索引组创建索引模式。问题是随着 6.0 版本的新映射更改,我无法从控制台添加任何新的索引模式。这是我在 5.5 中使用并运行良好的请求:
curl -XPOST "http://localhost:9200/.kibana/index-pattern" -H 'Content- Type: application/json' -d'
{
"title" : "index_name",
"timeFieldName" : "execution_time"
}'
这是我现在在 6.0 中从 ElasticSearch 得到的响应:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [.kibana] as the final mapping would have more than 1 type: [index-pattern, doc]"
}
],
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [.kibana] as the final mapping would have more than 1 type: [index-pattern, doc]"
},
"status": 400
}
我如何从控制台添加索引模式来避免这种多重映射问题?
最佳答案
URL 在 6.0.0 版本中已经更改,这里是新的 URL:
http://localhost:9200/.kibana/doc/doc:index-pattern:my-index-pattern-name
This CURL should work for you:
curl -XPOST "http://localhost:9200/.kibana/doc/index-pattern:my-index-pattern-name" -H 'Content-Type: application/json' -d'
{
"type" : "index-pattern",
"index-pattern" : {
"title": "my-index-pattern-name*",
"timeFieldName": "execution_time"
}
}'
关于elasticsearch - 使用 Kibana 6.0 或 7+ (v7.0.1) 从控制台创建索引模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47410250/