# Snapshot the most recent indexes only

**URL:** <https://discuss.elastic.co/t/snapshot-the-most-recent-indexes-only/206472>\
**Category:** Elasticsearch\
**Created:** [November 4, 2019, 8:07pm UTC](https://discuss.elastic.co/t/snapshot-the-most-recent-indexes-only/206472 "2019-11-04T20:07:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KeninHouston](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@KeninHouston](https://discuss.elastic.co/u/KeninHouston)\
**Post date:** [November 4, 2019, 8:07pm UTC](https://discuss.elastic.co/t/snapshot-the-most-recent-indexes-only/206472/1 "2019-11-04T20:07:29Z")

</div>

Hi,

I want to snapshot the most recent created indexes based on a pattern

assuming I have the following indexes in the cluster:

index1\_20191104  
index1\_20191103  
index2\_20191104  
index2\_20191101

I only want the snapshot to contain:

ndex1\_20191104  
index2\_20191104

Is there someway to create a snapshot based on this?

Any suggestions gratefully received

---

<div class="post-metadata">

**Author:** ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)\
**Post date:** [November 5, 2019, 12:26am UTC](https://discuss.elastic.co/t/snapshot-the-most-recent-indexes-only/206472/2 "2019-11-05T00:26:27Z")

</div>

@KeninHouston

I'm assuming your creating those indices via some naming pattern? You should be able to use the same pattern (as part of a `*_{dataMathExpression}` pattern) in the `"indices"` parameter.  
I think the documentation on [data naming patterns](https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html) and [multi index syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-index.html) should be helpful to you here.

---

<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:** [December 3, 2019, 12:26am UTC](https://discuss.elastic.co/t/snapshot-the-most-recent-indexes-only/206472/3 "2019-12-03T00:26:45Z")

</div>

Closed on December 3, 2019, 12:26am UTC

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