使用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 has 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?
推荐答案
URL在6.0.0版本中已更改,这是新的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屋!