# Dinamically assing template

**URL:** <https://discuss.elastic.co/t/dinamically-assing-template/20546>\
**Category:** Elasticsearch\
**Created:** [November 3, 2014, 9:20pm UTC](https://discuss.elastic.co/t/dinamically-assing-template/20546 "2014-11-03T21:20:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejandro\_Alves](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alejandro_alves/32/1074_2.png) [@Alejandro\_Alves](https://discuss.elastic.co/u/Alejandro_Alves)\
**Post date:** [November 3, 2014, 9:20pm UTC](https://discuss.elastic.co/t/dinamically-assing-template/20546/1 "2014-11-03T21:20:21Z")

</div>

Hello,  
I have read that it is possible to assing dynamic names to the indexes like  
this:

```
elasticsearch {
            cluster => "logstash"
            index => "logstash-%{clientid}-%{+YYYY.MM.dd}"
    }

```

What I am wondering is if it is possible to assing the template dynamically  
as well:

```
elasticsearch {
            cluster => "logstash"
            template => "/etc/logstash/conf.d/%{clientid}-template.json"
    }

```

Also where does the variable %{clientid} come from?

Thanks!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/819fe763-74b7-4a37-817c-9152547e9e42%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/819fe763-74b7-4a37-817c-9152547e9e42%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:52am UTC](https://discuss.elastic.co/t/dinamically-assing-template/20546/2 "2017-07-06T00:52:26Z")

</div>


