# Logstash and Elasticsearch ILM bootstrap index

**URL:** <https://discuss.elastic.co/t/logstash-and-elasticsearch-ilm-bootstrap-index/252310>\
**Category:** Logstash\
**Tags:** ilm-index-lifecycle-management\
**Created:** [October 16, 2020, 7:27am UTC](https://discuss.elastic.co/t/logstash-and-elasticsearch-ilm-bootstrap-index/252310 "2020-10-16T07:27:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikele](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikele/32/116173_2.png) [@Mikele](https://discuss.elastic.co/u/Mikele)\
**Post date:** [October 16, 2020, 7:27am UTC](https://discuss.elastic.co/t/logstash-and-elasticsearch-ilm-bootstrap-index/252310/1 "2020-10-16T07:27:16Z")

</div>

I need to dynamically create several types (with different index names) indexes in Elasticsearch from logstash. I need to use lifecycle (ILM) feature. My questions and either problems are:

1. How can I from logstash create bootstrap index automaticly? I would prefer to do not use Kibana because it will require to create initial (bootstrap) index every time someone from my application create new index.

It is more details but just to clarify indexes are somethink like app-something-12; app-something-13; app-something-23 etc. And numbers (12, 13 ect) are not running version of same index, but these are different indexes with different structures.

1. It is possible to create index templates directly from logstash also?

Check out my current configurations:

```auto
elasticsearch {
                hosts => ["127.0.0.1:9200"]
                index => "%{[@metadata][indexname]}" ##e.g app-something12
                user => "xxxxx"
                password => "yyyyy"
                ilm_enabled => true
                ilm_rollover_alias => "%{[@metadata][indexname]}"
                ilm_pattern => "000001"
                ilm_policy => "application-policy"
        }
}

Template:

{
  "application-template" : {
    "order" : 0,
    "index_patterns" : [
      "%{[@metadata][indexname]}-*"
    ],
    "settings" : {
      "index" : {
        "lifecycle" : {
          "name" : "application-policy",
          "rollover_alias" : "%{[@metadata][indexname]}"
        }
      }
    },
    "mappings" : { },
    "aliases" : { }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Mikele](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikele/32/116173_2.png) [@Mikele](https://discuss.elastic.co/u/Mikele)\
**Post date:** [October 19, 2020, 7:29am UTC](https://discuss.elastic.co/t/logstash-and-elasticsearch-ilm-bootstrap-index/252310/2 "2020-10-19T07:29:35Z")

</div>

kindly anyone help?

---

<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:** [November 16, 2020, 7:29am UTC](https://discuss.elastic.co/t/logstash-and-elasticsearch-ilm-bootstrap-index/252310/3 "2020-11-16T07:29:56Z")

</div>

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