使用 Kibana 6.0 或 7+ (v7.0.1) 从控制台创建索引模式 [英] Create index-patterns from console with Kibana 6.0 or 7+ (v7.0.1)
问题描述
我最近将我的 ElasticStack 实例从 5.5 升级到 6.0,似乎这个版本的一些重大变化已经损害了我的管道.我有一个脚本,它根据 ElasticSearch 中的索引自动为一些相似索引组创建索引模式.问题是,随着 6.0 版本的新映射更改,我无法从控制台添加任何新的索引模式.这是我在 5.5 中使用并运行良好的请求:
I recently upgraded my ElasticStack instance from 5.5 to 6.0, and it seems that some of the breaking changes of this version have harmed my pipeline. I had a script that, depending on the indices inside ElasticSearch, created index-patterns automatically for some groups of similar indices. The problem is that with the new mapping changes of the 6.0 version, I cannot add any new index-pattern from the console. This was the request I used and worked fine in 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 得到的响应:
This is the response I get now, in 6.0, from 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
}
如何从控制台添加索引模式以避免这种多重映射问题?
How could I add index-patterns from the console avoiding this multiple mapping issue?
推荐答案
6.0.0 版本修改了 URL,这里是新的 URL:
The URL has been changed in version 6.0.0, here is the new URL:
http://localhost:9200/.kibana/doc/doc:index-pattern:my-index-pattern-name
这个 CURL 应该适合你:
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"
}
}'
这篇关于使用 Kibana 6.0 或 7+ (v7.0.1) 从控制台创建索引模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!