# Reindexing glob of indices

**URL:** <https://discuss.elastic.co/t/reindexing-glob-of-indices/34881>\
**Category:** Elasticsearch\
**Created:** [November 18, 2015, 5:27am UTC](https://discuss.elastic.co/t/reindexing-glob-of-indices/34881 "2015-11-18T05:27:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![treehouse](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@treehouse](https://discuss.elastic.co/u/treehouse)\
**Post date:** [November 18, 2015, 5:27am UTC](https://discuss.elastic.co/t/reindexing-glob-of-indices/34881/1 "2015-11-18T05:27:07Z")

</div>

I have corrupted a set of indexes, `nginx-*` , by trying to modify the type of a particular field with the PUT mapping API. I get this error in Kibana settings/indices page:

```
A field is defined as several types (string, integer, etc) across the indices that match this pattern...

```

As this is not just one index, closer to 30, what is the best way to resolve this issue? I understand I may need to reindex

```
Correcting this issue will require reindexing your data.

```

Is there an easy way to reindex a glob of indices? eg, I want to reindex nginx-2015.11.15 to nginx-v2-2015.11.15 , for all dates. Or is my only real option to script this in python or bash or something? Does anyone have a clear example of how exactly to reindex? To me this article here is missing something critical -- [https://www.elastic.co/guide/en/elasticsearch/guide/current/reindex.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/reindex.html) -- the only example it gives is `GET /old_index/_search?search_type=scan&scroll=1m`.. so this is how you get the old data, but how exactly do you insert that into `new_index` ?

---

<div class="post-metadata">

**Author:** ![rusty](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@rusty](https://discuss.elastic.co/u/rusty)\
**Post date:** [November 18, 2015, 8:19am UTC](https://discuss.elastic.co/t/reindexing-glob-of-indices/34881/2 "2015-11-18T08:19:41Z")

</div>

You can use simple bash script (to iterate over indexes) and logstash to transfer data from one index to another. Look at [Reindex using bulk api](https://discuss.elastic.co/t/reindex-using-bulk-api/31713/2)

---

<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:** [July 5, 2017, 11:37pm UTC](https://discuss.elastic.co/t/reindexing-glob-of-indices/34881/3 "2017-07-05T23:37:44Z")

</div>


