Home > Blockchain >  Need help to understand the difference between GET /_index_template/<template name> and GET _c
Need help to understand the difference between GET /_index_template/<template name> and GET _c

Time:11-05

In elastic _cat/templates?v output, I see two templates:

"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": "[]"
},

However, when I try to check the template name using GET /_index_template/, only "flowlog" returns a result but "flowlogtmplt" returns 404 error. Why does not elastic recognize "flowlogtmplt" as index template?

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
}

This is related to need-help-to-understand-elasticsearch-mapping-output Thank you.

CodePudding user response:

GET _cat/templates returns

So you should try this instead

GET _template/flowlogtmplt
  • Related