Backing index name with date

is it possible to have a date in the backing index name? on each rollover i would like to have an index with the name with pattern of myindex-{now/d{yyyy.MM.dd}|+3:00}}

Hello @fisherijus,

could you give me a example of what this would look like? so would it look like myindex-2023.03.08? I don’t exactly know what you mean by |+3:00 in your example - should 3 hours be added to the date?

Furthermore how are you creating the pipeline, would that be using logstash or some other service? In theory it is totally possible to do so.

BR,
Andreas

if i configure the datastream with rolleover policy (1d), all backing indexes get the name with suffix .0000x. if my index is my-index, then it gets a name like .ds-my-index-00000x.
i would like that all backing indexes would have a date added in the name. like
ds-my-index-2023-03-07-000001, ds-my-index-2023-03-08-000002, etc…

i think i would be able to do this functionality with aliases and indexes, but now i am trying to do it with data stream…

i will be using logstash, but i will get to it after i set up my opensearch…

This is feature I am looking for as well, when rolling over for data stream takes place, the backing index have naming that has date in it. it seems Elastic has something like that:

Use date math with index alias rollovers

If you use an index alias for time series data, you can use date math in the index name to track the rollover date. For example, you can create an alias that points to an index named <my-index-{now/d}-000001>. If you create the index on May 6, 2099, the index’s name is my-index-2099.05.06-000001. If you roll over the alias on May 7, 2099, the new index’s name is my-index-2099.05.07-000002.

refer to: Rollover API | Elasticsearch Guide [8.15] | Elastic

1 Like

same here

Did you got any way to do so ??

Thats a solid approach!

Unfortunately datastreams rollover doesn’t work as expected and documented! Spent many hours trying to figure it out with all permutations and combinations. It just does not work.