在elastic _cat/templates中?v输出,我看到两个模板:
"1": {
"name": "flowlogtmplt",
"index_patterns": "[flowlog*, flowobsrv*]",
"order": "0",
"version": null,
"composed_of": ""
},
"14": {
"name": "flowlog",
"index_patterns": "[flowlog-*]",
"order": "0",
"version": null,
"composed_of": "[]"
},
然而,当我尝试使用GET /_index_template/检查模板名称时,只有“flowlog”返回结果,但“flowlogtmplt”返回404错误。为什么弹性不承认“flowlogtmplt”作为索引模板?
GET /_index_template/flowlog
{
"index_templates": [
{
"name": "flowlog",
"index_template": {
"index_patterns": [
"flowlog-*"
],
"template": {
"settings": {
"index": {
"lifecycle": {
"name": "flowlog"
}
}
}
},
"composed_of": []
}
}
]
}
GET /_index_template/flowlogtmplt
{
"error": {
"root_cause": [
{
"type": "resource_not_found_exception",
"reason": "index template matching [flowlogtmplt] not found"
}
],
"type": "resource_not_found_exception",
"reason": "index template matching [flowlogtmplt] not found"
},
"status": 404
}
1条答案
按热度按时间nqwrtyyt1#
GET _cat/templates
返回GET _template/*
得到的一样GET _index_template/*
得到的相同的值返回所以你应该试试这个