# How to reindex using last weeks

**URL:** <https://discuss.elastic.co/t/how-to-reindex-using-last-weeks/218618>\
**Category:** Elasticsearch\
**Created:** [February 10, 2020, 3:06pm UTC](https://discuss.elastic.co/t/how-to-reindex-using-last-weeks/218618 "2020-02-10T15:06:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mouloud\_CHIKHOUNE](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mouloud_chikhoune/32/46957_2.png) [@Mouloud\_CHIKHOUNE](https://discuss.elastic.co/u/Mouloud_CHIKHOUNE)\
**Post date:** [February 10, 2020, 3:06pm UTC](https://discuss.elastic.co/t/how-to-reindex-using-last-weeks/218618/1 "2020-02-10T15:06:06Z")

</div>

Hello,  
I have a metricbeat index. "metricbeat" index contains documents from 2019 and 2020. I want to re-index the documents from last weekend (w-1) and (w-2) (w-n).

example:

```auto
POST _reindex
{
  "source": {
    "index": "metricbeat*"
  },
  "dest": {
    "pipeline": "metricbeat_reindex",
    "index": "metricbeat-lastweek"
  }
}

```

I'm looking for a pipeline "metricbeat\_reindex" to determine the documents of the past week (w-1) and (w-n).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 10, 2020, 5:01pm UTC](https://discuss.elastic.co/t/how-to-reindex-using-last-weeks/218618/2 "2020-02-10T17:01:48Z")

</div>

I'm just wondering if you should not use this: [https://www.elastic.co/guide/en/elasticsearch/reference/current/date-index-name-processor.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/date-index-name-processor.html) ? With `w` as the `date_rounding` parameter.

---

<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 9, 2020, 5:01pm UTC](https://discuss.elastic.co/t/how-to-reindex-using-last-weeks/218618/3 "2020-03-09T17:01:55Z")

</div>

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