I have elk stack deployed from deviantony/docker-elk version 8.9 .
And i'm trying to create lifecycle with retention policy for my datastream as mentioned in official documentetion
PUT _index_template/my-index-template
{
"index_patterns": ["my-data-stream*"],
"data_stream": { },
"priority": 500,
"template": {
"lifecycle": {
"data_retention": "7d"
}
},
"_meta": {
"description": "Template with data stream lifecycle"
}
}
but i got error
{
"error": {
"root_cause": [
{
"type": "x_content_parse_exception",
"reason": "[6:5] [template] unknown field [lifecycle]"
}
],
"type": "x_content_parse_exception",
"reason": "[6:18] [index_template] failed to parse field [template]",
"caused_by": {
"type": "x_content_parse_exception",
"reason": "[6:5] [template] unknown field [lifecycle]"
}
},
"status": 400
}
Any ideas?
I got the answer from Elastic team member that for now it is experimental feature and extra steps should be performed for it to work. Link to answer: https://discuss.elastic.co/t/elasticsearch-x-content-parse-exception-template-unknown-field-lifecycle/340009/3