# Dynamic index not working according to month

**URL:** <https://discuss.elastic.co/t/dynamic-index-not-working-according-to-month/105980>\
**Category:** Elasticsearch\
**Created:** [November 1, 2017, 6:20am UTC](https://discuss.elastic.co/t/dynamic-index-not-working-according-to-month/105980 "2017-11-01T06:20:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinay\_garg](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vinay\_garg](https://discuss.elastic.co/u/vinay_garg)\
**Post date:** [November 1, 2017, 6:20am UTC](https://discuss.elastic.co/t/dynamic-index-not-working-according-to-month/105980/1 "2017-11-01T06:20:10Z")

</div>

Hi,

I have below define configuration  
input {  
beats {  
port =\> "5051"  
type =\> "haproxy\_66"  
}  
}  
output {  
if [type] == "haproxy\_66" {  
elasticsearch {  
hosts =\> "127.0.0.1:9200"  
index =\> "haproxy\_66-%{+YYYY-MM-dd}"  
}  
stdout{  
codec =\> "rubydebug"  
}  
}

Accordingly index will be create according to date and month, according to dynamic day date, index create, but as month change from October to November, Index not created.

curl '[http://localhost:9200/\_cat/indices?v](http://localhost:9200/_cat/indices?v)'  
yellow open haproxy\_66-2017-10-29 3nF7IMAAQYu5EnGMiklnMg 5 1 90025 0 85.2mb 85.2mb  
yellow open haproxy\_66-2017-10-31 M4l8aXMhQYmawOU8b4ZXXw 5 1 655149 0 571.8mb 571.8mb  
yellow open haproxy\_66-2017-10-30 FhcMKVHhR4aVxZfD1lz5Zg 5 1 577437 0 507.1mb 507.1mb

Can anyone help me on it?

---

<div class="post-metadata">

**Author:** ![vinay\_garg](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vinay\_garg](https://discuss.elastic.co/u/vinay_garg)\
**Post date:** [November 1, 2017, 6:44am UTC](https://discuss.elastic.co/t/dynamic-index-not-working-according-to-month/105980/2 "2017-11-01T06:44:51Z")

</div>

Solved

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 1, 2017, 9:32am UTC](https://discuss.elastic.co/t/dynamic-index-not-working-according-to-month/105980/3 "2017-11-01T09:32:39Z")

</div>

Could you edit your answer and give the solution?

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```
````

---

<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 29, 2017, 9:33am UTC](https://discuss.elastic.co/t/dynamic-index-not-working-according-to-month/105980/4 "2017-11-29T09:33:17Z")

</div>

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