I am trying to create an index template. Following the examples in getting-started-index-lifecycle-management and indices-templates I'm trying with a PUT
request that looks like:
http://<elasticsearch_ip>:9200/_index_template/name-of-index-template
with body:
{
"index_patterns": [
"some.*.thing"
],
"data_stream": {
"timestamp_field": "tsField"
},
"template": {
"mappings": {
"dynamic": true,
"date_detection": true,
"dynamic_date_formats": [
"epoch_millis"
],
"numeric_detection": false,
"_source": {
"enabled": false,
"includes": [],
"excludes": []
},
"_routing": {
"required": false
},
"meta": {},
"properties": {
"someId": {
"type": "keyword",
"ignore_above": 256,
"norms": false
},
"some_metric": {
"type": "float"
},
"some_boolean": {
"type": "byte"
},
"tsField": {
"type": "date",
"format": "epoch_millis"
}
}
},
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1,
"index.lifecycle.name": "retention-1-week"
}
}
}
but I get the following error:
{
"error": "Incorrect HTTP method for uri [/_index_template/name-of-index-template] and method [PUT], allowed: [POST]",
"status": 405
}
Would you know what's wrong with how I structured my request?
Thanks in advance.