# How to select an index template from a logstash pipeline?

**URL:** <https://discuss.elastic.co/t/how-to-select-an-index-template-from-a-logstash-pipeline/232504>\
**Category:** Logstash\
**Created:** [May 13, 2020, 7:32pm UTC](https://discuss.elastic.co/t/how-to-select-an-index-template-from-a-logstash-pipeline/232504 "2020-05-13T19:32:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Incauto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/incauto/32/60149_2.png) [@Incauto](https://discuss.elastic.co/u/Incauto)\
**Post date:** [May 13, 2020, 7:32pm UTC](https://discuss.elastic.co/t/how-to-select-an-index-template-from-a-logstash-pipeline/232504/1 "2020-05-13T19:32:42Z")

</div>

I have made an index template with the following index pattern:

```auto
POST _template/myindex-template
{
 "index_patterns": [
   "myindex-*"
 ],
 "settings": { .....

```

for what I understand just by using the index pattern in the name of the index, the index template will be applied:

```auto
output {
        elasticsearch { hosts => ["elastic_ip"] index => "myindex-cpu-%{+YYYY.MM}" 
}

```

but it doesnt seems to work, do I need to specify something else?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 14, 2020, 1:34am UTC](https://discuss.elastic.co/t/how-to-select-an-index-template-from-a-logstash-pipeline/232504/2 "2020-05-14T01:34:45Z")

</div>

You probably need to explicitly set this one to `no` - [https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-manage\_template](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-manage_template)

That way your template will be used.

---

<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:** [June 11, 2020, 1:34am UTC](https://discuss.elastic.co/t/how-to-select-an-index-template-from-a-logstash-pipeline/232504/3 "2020-06-11T01:34:47Z")

</div>

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