# SLM indices list does not support date math format?

**URL:** <https://discuss.elastic.co/t/slm-indices-list-does-not-support-date-math-format/221697>\
**Category:** Elasticsearch\
**Created:** [March 2, 2020, 2:16pm UTC](https://discuss.elastic.co/t/slm-indices-list-does-not-support-date-math-format/221697 "2020-03-02T14:16:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![josejfb](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@josejfb](https://discuss.elastic.co/u/josejfb)\
**Post date:** [March 2, 2020, 2:16pm UTC](https://discuss.elastic.co/t/slm-indices-list-does-not-support-date-math-format/221697/1 "2020-03-02T14:16:42Z")

</div>

Hello. In my Elasticsearch setup (7.5.2) we have daily indices named myindex-2020.03.01, myindex-2020.03.02, .... I'm trying to setup a SLM policy that runs everyday and includes all indices for the past month.

For that I was trying to use the date math index name resolution in the `indices` config list when creating the policy.

```
curl -X PUT "localhost:9200/_slm/policy/nightly-snapshots?pretty" -H 'Content-Type: application/json' -d'
{
  "schedule": "0 30 1 * * ?", 
  "name": "<nightly-month-snap-{now/d}>", 
  "repository": "myrepo-backup", 
  "config": { 
    "indices": ["%3Cmyindex-%7Bnow%2FM%7Byyyy.MM.*%7D%7D%3E"]
  }
}
'

```

Note: the `indices` key decoded is `"<myindex-{now/M{yyyy.MM.*}}>"`

The policy is created properly but when I run it the snapshot created contains 0 indices instead of the corresponding indices of the month.

When I run the query `GET /%3Cmyindex-%7Bnow%2FM%7Byyyy.MM.*%7D%7D%3E` in the Kibana dev tool console I get a proper output with the existing matching indices. Same proper behaviour when I run the query via curl:

`curl -X GET http://localhost:9200/%3Cmyindex-%7Bnow%2FM%7Byyyy.MM.*%7D%7D%3E`

Also, if I create a policy with a wildcard in the `indices` key and run that policy, the snapshot created contains the desired indices.

```
curl -X PUT "localhost:9200/_slm/policy/nightly-snapshots?pretty" -H 'Content-Type: application/json' -d'
{
  "schedule": "0 30 1 * * ?", 
  "name": "<nightly-month-snap-{now/d}>", 
  "repository": "myrepo-backup", 
  "config": { 
    "indices": ["myindex-2020.03.*"]
  }
}
'

```

Can someone advice if the date math support is not available for this use case or am I doing something wrong? Or maybe it is a bug...

Thank you very much for your help.

Regards,  
/José Carlos

---

<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:** [March 30, 2020, 2:16pm UTC](https://discuss.elastic.co/t/slm-indices-list-does-not-support-date-math-format/221697/2 "2020-03-30T14:16:45Z")

</div>

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