How to automatically apply ILM to an new index created by Firehose

0

We have a Kinesis Firehose sending logs to AWS Elasticsearch and it creates a new index each day.
I created an Index Lifecycle Policy to delete an index after 2 days and that works fine if I apply it via Kibana Index Management manually. What I need to do is apply the Policy to an index when it is created by the firehose.
The Elasticsearch docs shows this can be done with the below template but AWS Kibana does not support the index.lifecycle.name. I get an unknown setting error.
Does anyone know how I can automatically apply an ILM Policy to an Index and I must be able to wildcard it since the Firehose tacks on a date.
Thanks in advance

-------- This is the template I am trying to PUT -----------------
PUT _template/testindex_template
{
"index_patterns": ["test-index*"],
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1,
"index.lifecycle.name": "delete_index_policy"
}
}

------- This is the error -----------------
{
"error": {
"root_cause": [
{
"type": "remote_transport_exception",
"reason": "[b81eac543fece630b97c35b7b84acae3][x.x.x.x:9300][indices:admin/template/put]"
}
],
"type": "illegal_argument_exception",
"reason": "unknown setting [index.lifecycle.name] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
},
"status": 400
}

P.S. I also create a Rollover Lifecycle policy but same issue with that. The Delete policy doesn't get applied to the index that is rolled over.

KevC
質問済み 4年前746ビュー
3回答
0

Figured it out.
Need to us opendistro in the key for the template as follows:
{
"index_patterns": ["test-*"],
"settings": {
"opendistro.index_state_management.policy_id": "zero_replica_and_delete_index"
}
}

KevC
回答済み 4年前
0

See latest reply

KevC
回答済み 4年前
0

Did this work for you? If I do the same, then the templates seems to accept the "opendistro.index_state_management.policy_id" setting, but after a while - if I get the template again through the API - it was removed from the settings.

Is there another way to apply policies automatically to new indices that match a certain pattern?

Regards,
MdB

MdBdVB
回答済み 4年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ