# Date math expression for index pattern

**URL:** <https://discuss.elastic.co/t/date-math-expression-for-index-pattern/222406>\
**Category:** Beats\
**Tags:** ilm-index-lifecycle-management\
**Created:** [March 6, 2020, 5:25am UTC](https://discuss.elastic.co/t/date-math-expression-for-index-pattern/222406 "2020-03-06T05:25:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthick2020](https://avatars.discourse-cdn.com/v4/letter/k/eb9ed0/32.png) [@karthick2020](https://discuss.elastic.co/u/karthick2020)\
**Post date:** [March 6, 2020, 5:25am UTC](https://discuss.elastic.co/t/date-math-expression-for-index-pattern/222406/1 "2020-03-06T05:25:04Z")

</div>

Hi Team,  
Currently we have enabled weekly rollover for metricbeat, winlogbeat & logstash index. I have following 2 queries on ILM,

1. From documentation, understood that Logstash uses Joda to format the index pattern from event timestamp & should be updated as "\<indexName-{now/w{xxxx.ww}}\>" to set weekly rollover. Is this applicable for other agents like metricbeat, heartbeat & winlogbeat and should be defined weekyear as "xxxx" instead of "yyyy"?

2. Does it support to show only first date of the week as part of index pattern, e.g. indexName-2020-03-02 instead of indexName-2020-10? for weekly rollover?

Thanks,  
Karthick

---

<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:** [April 3, 2020, 7:25am UTC](https://discuss.elastic.co/t/date-math-expression-for-index-pattern/222406/2 "2020-04-03T07:25:13Z")

</div>

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