# How to auto apply index policy to newly created indexes in AWS Elasticsearch

**URL:** <https://discuss.elastic.co/t/how-to-auto-apply-index-policy-to-newly-created-indexes-in-aws-elasticsearch/254734>\
**Category:** Elasticsearch\
**Created:** [November 9, 2020, 10:56am UTC](https://discuss.elastic.co/t/how-to-auto-apply-index-policy-to-newly-created-indexes-in-aws-elasticsearch/254734 "2020-11-09T10:56:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitin194](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nitin194/32/92246_2.png) [@nitin194](https://discuss.elastic.co/u/nitin194)\
**Post date:** [November 9, 2020, 10:56am UTC](https://discuss.elastic.co/t/how-to-auto-apply-index-policy-to-newly-created-indexes-in-aws-elasticsearch/254734/1 "2020-11-09T10:56:51Z")

</div>

We push Nginx logs to AWS Elasticsearch using Filebeat and Logstash. We have created an index pattern with the name nginx-error-logs\* & nginx-access-logs\*. We can see in Kibana that daily new indices are being created based on the nginx log file date pattern. We created index policy and applied to existing indices but we would like to auto-apply the same ISM policy for all the newly created indices in Elasticsearch. Kindly help us to achieve this?

Is this the correct format to apply in Devtools console?

```
PUT _template/testindex_template
{
  "index_patterns": ["*"],
  "settings": {
    "opendistro.index_state_management.policy_id": "index_lifecycle_management_policy"
  }
}

```

should that be applied on the filebeat or Logstash config?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 9, 2020, 12:35pm UTC](https://discuss.elastic.co/t/how-to-auto-apply-index-policy-to-newly-created-indexes-in-aws-elasticsearch/254734/2 "2020-11-09T12:35:59Z")

</div>

We don't support this on this forum. you should ask on the opendistro forum instead.

BTW did you look at [Cloud by Elastic](https://www.elastic.co/cloud), also available if needed from [AWS Marketplace](https://aws.amazon.com/marketplace/pp/B01N6YCISK) ?

Cloud by elastic is one way to have access to **all features** , all managed by us. Think about what is there yet like Security, Monitoring, Reporting, SQL, Canvas, Maps UI, Alerting and built-in solutions named [Observability](https://www.elastic.co/observability), [Security](https://www.elastic.co/security), [Enterprise Search](https://www.elastic.co/enterprise-search) and what is coming next 🙂 ...

---

<div class="post-metadata">

**Author:** ![nitin194](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nitin194/32/92246_2.png) [@nitin194](https://discuss.elastic.co/u/nitin194)\
**Post date:** [November 9, 2020, 1:03pm UTC](https://discuss.elastic.co/t/how-to-auto-apply-index-policy-to-newly-created-indexes-in-aws-elasticsearch/254734/3 "2020-11-09T13:03:49Z")

</div>

Thank you @dadoonet for the feedback. I will ask this in a separate forum.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 7, 2020, 1:03pm UTC](https://discuss.elastic.co/t/how-to-auto-apply-index-policy-to-newly-created-indexes-in-aws-elasticsearch/254734/4 "2020-12-07T13:03:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
