# Using Curator to reindex multiple dailies into a single daily?

**URL:** https://discuss.elastic.co/t/using-curator-to-reindex-multiple-dailies-into-a-single-daily/167502
**Category:** Elasticsearch
**Tags:** curator
**Created:** [February 7, 2019, 6:29pm UTC](https://discuss.elastic.co/t/using-curator-to-reindex-multiple-dailies-into-a-single-daily/167502 "2019-02-07T18:29:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rj-reilly](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rj-reilly/32/24568_2.png) [@rj-reilly](https://discuss.elastic.co/u/rj-reilly)
#### Post date: [February 7, 2019, 6:29pm UTC](https://discuss.elastic.co/t/using-curator-to-reindex-multiple-dailies-into-a-single-daily/167502/1 "2019-02-07T18:29:07Z")

</div>

Hi, I have 5 indexes created daily, on the following day I would like to combine them into a single index using curator. I am not sure on how to setup the filter to only do based on name and date for just the one day.  
i.e  
data-066223-2019.02.05  
data-342434-2019.02.05  
data-980973-2019.02.05  
data-450234-2019.02.05  
data-963237-2019.02.05

then after midnight reindex to data-2019.02.05  
thanks !  
rob

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [February 7, 2019, 6:50pm UTC](https://discuss.elastic.co/t/using-curator-to-reindex-multiple-dailies-into-a-single-daily/167502/2 "2019-02-07T18:50:37Z")

</div>

My first question is why they are in separate indices in the first place, if you're planning on re-joining them?

---

<div class="post-metadata">

### Author: ![rj-reilly](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rj-reilly/32/24568_2.png) [@rj-reilly](https://discuss.elastic.co/u/rj-reilly)
#### Post date: [February 7, 2019, 6:53pm UTC](https://discuss.elastic.co/t/using-curator-to-reindex-multiple-dailies-into-a-single-daily/167502/3 "2019-02-07T18:53:50Z")

</div>

for now that is out of my control, the app team needs to make the change and I am just trying to reduce the number of shards/indexes in the cluster to keep it managable.

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [February 7, 2019, 7:16pm UTC](https://discuss.elastic.co/t/using-curator-to-reindex-multiple-dailies-into-a-single-daily/167502/4 "2019-02-07T19:16:28Z")

</div>

Gotcha.

```auto
- filtertype: pattern
  kind: regex
  value: '^data-\d{6}-\d{4}\.\d{2}\.\d{2}$'
- filtertype: period
  period_type: relative
  source: name
  range_from: -1
  range_to: -1
  timestring: '%Y.%m.%d'
  unit: days

```

If you run this after UTC midnight, these two filters should find all indices matching `data-(6 digits)-(4 digits).(2 digits).(2 digits)` that were were created the previous day.

You can test/verify this by using `--dry-run`.

The target index would have to be named `<data-{now/d-1d}>`, as you want it to have _yesterday's_ date on it.

---

<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 7, 2019, 7:16pm UTC](https://discuss.elastic.co/t/using-curator-to-reindex-multiple-dailies-into-a-single-daily/167502/5 "2019-03-07T19:16:33Z")

</div>

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