# Index template not match for logs

**URL:** <https://discuss.elastic.co/t/index-template-not-match-for-logs/257008>\
**Category:** Elasticsearch\
**Created:** [November 29, 2020, 9:01pm UTC](https://discuss.elastic.co/t/index-template-not-match-for-logs/257008 "2020-11-29T21:01:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zakabluk](https://avatars.discourse-cdn.com/v4/letter/z/8baadc/32.png) [@zakabluk](https://discuss.elastic.co/u/zakabluk)\
**Post date:** [November 29, 2020, 9:01pm UTC](https://discuss.elastic.co/t/index-template-not-match-for-logs/257008/1 "2020-11-29T21:01:01Z")

</div>

I tride create index template with ilm policy.  
My logsatsh output has

```auto
index => "logstash-logs-lb-%{+YYYY.MM.dd}"

```

Index template with config

```auto
PUT _template/logstash-logs-lb
{
  "order": 0,
  "index_patterns": [
    "logstash-logs-lb-*"
  ],
  "settings": {
    "index": {
      "lifecycle": {
        "name": "logstash-logs-lb",
        "rollover_alias": "logstash-logs-lb-alias"
      },
      "number_of_shards": "2",
      "priority": "200",
      "number_of_replicas": "1"
    }
  }
}

```

When I start up my logstash I got whery strange index which contain my ilm policy but replicas and shards count is wrong.

```auto
{
  "settings": {
    "index": {
      "lifecycle": {
        "name": "logstash-logs-lb",
        "rollover_alias": "logstash-logs-lb-alias"
      },
      "refresh_interval": "5s",
      "number_of_shards": "1",
      "provided_name": "logstash-logs-lb-2020.11.29",
      "creation_date": "1606682711526",
      "priority": "100",
      "number_of_replicas": "1",
.....
      }
    }
  },

```

Why?

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [November 30, 2020, 12:45am UTC](https://discuss.elastic.co/t/index-template-not-match-for-logs/257008/2 "2020-11-30T00:45:46Z")

</div>

There will be a message in elasticsearch log when the index was created listing all templates that were applied at creation. Check that the template mentioned was the only template applied.

---

<div class="post-metadata">

**Author:** ![zakabluk](https://avatars.discourse-cdn.com/v4/letter/z/8baadc/32.png) [@zakabluk](https://discuss.elastic.co/u/zakabluk)\
**Post date:** [November 30, 2020, 8:39am UTC](https://discuss.elastic.co/t/index-template-not-match-for-logs/257008/3 "2020-11-30T08:39:55Z")

</div>

Thank you! It's true. Elastic took two policys.

---

<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 28, 2020, 8:40am UTC](https://discuss.elastic.co/t/index-template-not-match-for-logs/257008/4 "2020-12-28T08:40:15Z")

</div>

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