How to create snapshot on datastream

Hello. Until recently I was using regular indexes for data collection. Every month there was a new index and i could snapshot indices by month and send them to my repo and delete them in elastic. Now I've changed data collection to datastream and I can't figure it out, if it's still possible to maintain the same retention as before. I see that there are indices inside datastream but don't know if I can snapshot them one by one and transfer them to repo and of course delete them inside datastream.
thx for any suggestions.

Hi @meternich ,

Welcome to the community!

When you take snapshot of data streams and all the backing up indices and meta data of that particular data stream will also be backed up, this is a snippet from the elastic documentation about the same-

If you include a data stream in a snapshot, the snapshot also includes the stream’s backing indices and metadata.

You can also include only specific backing indices in a snapshot. However, the snapshot won’t include the data stream’s metadata or its other backing indices.

A snapshot can include a data stream but exclude specific backing indices. When you restore such a data stream, it will contain only backing indices in the snapshot. If the stream’s original write index is not in the snapshot, the most recent backing index from the snapshot becomes the stream’s write index.

The retention order will also be the same in data stream, data stream is just a logical abstraction of many backing up indices and hence the snapshot and restore mechanism would work just same and keep in mind that snapshots are incremental in nature and are point in time.

Please find below the link to the documentation about the same-
[Create a snapshot | Elasticsearch Guide [8.5] | Elastic]Link

Thanks & Regards
Raj

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