elasticsearch 需要帮助以了解GET /_index_template/〈模板名称>和GET _cat/templates?v输出之间的区别

qcuzuvrc  于 2022-11-22  发布在  ElasticSearch
关注(0)|答案(1)|浏览(160)

在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错误。为什么elastic无法将“flowlogtmplt”识别为索引模板?

GET /_索引_模板/流日志

{
    "index_templates": [
        {
            "name": "flowlog",
            "index_template": {
                "index_patterns": [
                    "flowlog-*"
                ],
                "template": {
                    "settings": {
                        "index": {
                            "lifecycle": {
                                "name": "flowlog"
                            }
                        }
                    }
                },
                "composed_of": []
            }
        }
    ]
}

GET /_索引模板/流程日志mplt

{
    "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有关,谢谢。

hrirmatl

hrirmatl1#

GET _cat/templates返回

所以你应该试试这个

GET _template/flowlogtmplt

相关问题