# Index Name pattern

**URL:** <https://discuss.elastic.co/t/index-name-pattern/89623>\
**Category:** Logstash\
**Created:** [June 15, 2017, 8:05pm UTC](https://discuss.elastic.co/t/index-name-pattern/89623 "2017-06-15T20:05:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul.dhammy](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rahul.dhammy](https://discuss.elastic.co/u/rahul.dhammy)\
**Post date:** [June 15, 2017, 8:05pm UTC](https://discuss.elastic.co/t/index-name-pattern/89623/1 "2017-06-15T20:05:31Z")

</div>

I am trying to give a name to my index, surprisingly the supported pattern is not working as well.

When I give the name in format **appName-%{+[YYYY.MM](http://YYYY.MM)}** - This works  
When I try to append the week of the year by using **appName-%{+YYYY.MM.W}** - This does not works and logstash logs throws error "Illegal pattern component: W"

Please help.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 15, 2017, 8:13pm UTC](https://discuss.elastic.co/t/index-name-pattern/89623/2 "2017-06-15T20:13:33Z")

</div>

According to [http://www.joda.org/joda-time/key\_format.html](http://www.joda.org/joda-time/key_format.html) it's "w" and not "W".

---

<div class="post-metadata">

**Author:** ![rahul.dhammy](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rahul.dhammy](https://discuss.elastic.co/u/rahul.dhammy)\
**Post date:** [June 15, 2017, 8:26pm UTC](https://discuss.elastic.co/t/index-name-pattern/89623/3 "2017-06-15T20:26:46Z")

</div>

Thanks Magnus! That worked.  
Pardon my limited knowledge for this. What is this Joda pattern, I referred to the logstash date patterns and that had "W"  
[https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html)

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 15, 2017, 8:30pm UTC](https://discuss.elastic.co/t/index-name-pattern/89623/4 "2017-06-15T20:30:13Z")

</div>

No, that page actually says "w". Look carefully.

Joda-Time is the underlying date parsing library that Logstash uses.

---

<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 13, 2017, 8:30pm UTC](https://discuss.elastic.co/t/index-name-pattern/89623/6 "2017-07-13T20:30:41Z")

</div>

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