# Dynamic index routing allocation based on index name / regex

**URL:** <https://discuss.elastic.co/t/dynamic-index-routing-allocation-based-on-index-name-regex/67503>\
**Category:** Elasticsearch\
**Created:** [November 29, 2016, 3:02pm UTC](https://discuss.elastic.co/t/dynamic-index-routing-allocation-based-on-index-name-regex/67503 "2016-11-29T15:02:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlc](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@mlc](https://discuss.elastic.co/u/mlc)\
**Post date:** [November 29, 2016, 3:02pm UTC](https://discuss.elastic.co/t/dynamic-index-routing-allocation-based-on-index-name-regex/67503/1 "2016-11-29T15:02:14Z")

</div>

Hello,

I was wondering if its possible to define index.routing.allocation attributes for an index pattern instead of an specific index or the cluster wide option.

Lets say I have and will always have k1, k2 as a prefix in the index name for all my existing and possible new indices. Can I do something like:

if index\_name /k1-_/ apply: "index.routing.allocation.include.myattribute": "big"  
if index\_name /k2-_/ apply: "index.routing.allocation.include.myattribute": "small"

Thanks a lot  
Manuel

---

<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 27, 2016, 3:02pm UTC](https://discuss.elastic.co/t/dynamic-index-routing-allocation-based-on-index-name-regex/67503/2 "2016-12-27T15:02:15Z")

</div>

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