# Getting month from weekyear date in logstash output

**URL:** <https://discuss.elastic.co/t/getting-month-from-weekyear-date-in-logstash-output/162579>\
**Category:** Logstash\
**Created:** [January 1, 2019, 7:54pm UTC](https://discuss.elastic.co/t/getting-month-from-weekyear-date-in-logstash-output/162579 "2019-01-01T19:54:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![74db36a597f21b891b3f](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/74db36a597f21b891b3f/32/45367_2.png) [@74db36a597f21b891b3f](https://discuss.elastic.co/u/74db36a597f21b891b3f)\
**Post date:** [January 1, 2019, 7:54pm UTC](https://discuss.elastic.co/t/getting-month-from-weekyear-date-in-logstash-output/162579/1 "2019-01-01T19:54:06Z")

</div>

Hello.

I use this kind of date format for index naming index =\> "logstash-%{+xxxx.MM-ww}".  
And it had been working for last year till today. When index name should have "2019.01-01" in date (year.month-week) it has "2019.12-01".  
Does it working by design or it is some kind of mistake?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 8, 2019, 3:42pm UTC](https://discuss.elastic.co/t/getting-month-from-weekyear-date-in-logstash-output/162579/2 "2019-01-08T15:42:28Z")

</div>

I think it is working as designed. The week in which January first occurred started in December.

Reading through [this](https://github.com/logstash-plugins/logstash-output-elasticsearch/issues/541) might help. Or not 🙂

---

<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:** [February 5, 2019, 3:42pm UTC](https://discuss.elastic.co/t/getting-month-from-weekyear-date-in-logstash-output/162579/3 "2019-02-05T15:42:29Z")

</div>

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