在彈性 _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”識別為索引模板?
獲取 /_index_template/flowlog
{
"index_templates": [
{
"name": "flowlog",
"index_template": {
"index_patterns": [
"flowlog-*"
],
"template": {
"settings": {
"index": {
"lifecycle": {
"name": "flowlog"
}
}
}
},
"composed_of": []
}
}
]
}
獲取 /_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
}
這與need-help-to-understand-elasticsearch-mapping-output有關 謝謝。
uj5u.com熱心網友回復:
GET _cat/templates回傳
- 舊版 v1 模板,即您從中獲得的相同模板
GET _template/* - 新的v2 可組合索引模板
GET _index_template/*,即您從退貨中獲得的相同模板
所以你應該試試這個
GET _template/flowlogtmplt
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/530381.html
標籤:弹性搜索
