# Using logstash to reindex Elasticsearch

**URL:** https://discuss.elastic.co/t/using-logstash-to-reindex-elasticsearch/29493
**Category:** Logstash
**Created:** [September 17, 2015, 4:04pm UTC](https://discuss.elastic.co/t/using-logstash-to-reindex-elasticsearch/29493 "2015-09-17T16:04:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ramdev\_Wudali](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramdev_wudali/32/7894_2.png) [@Ramdev\_Wudali](https://discuss.elastic.co/u/Ramdev_Wudali)
#### Post date: [September 17, 2015, 4:04pm UTC](https://discuss.elastic.co/t/using-logstash-to-reindex-elasticsearch/29493/1 "2015-09-17T16:04:58Z")

</div>

I recently read DavidPilato's blog post : [http://david.pilato.fr/blog/2015/05/20/reindex-elasticsearch-with-logstash/](http://david.pilato.fr/blog/2015/05/20/reindex-elasticsearch-with-logstash/)  
Its a cool thing you can do, and for the most part it works just like David mentioned except for some problems :

1. It does not seem to work with creating the index based on a template. (I would like to copy the content from instance1\_index1 and write it to instance2\_index2(which is based on a template))

2. If I provide a type, it issues a warning saying the index\_type declaration is deprecated, and then proceeds to spew out errors :

here is my config ;

```
input {
   elasticsearch {
     hosts => ["porto.int.thomsonreuters.com"]
     port => "7200"
     index => "blip-2015.09.15"
     scroll => "5m"
     docinfo => true
     query => '{"query": {"filtered": {"filter": {"exists": {"field": "raw.place.bounding_box.coordinates"}}}}}'
   }
}

filter {
  mutate {
    remove_field => ["atimestamp","@version"]
    update => {"raw.place.bounding_box.type" => "multipoint" }
  }
}

output {
   elasticsearch {
     host => "localhost"
     port => 9200
     protocol => "http"
     index => "%{[@metadata][_index]}"
     #index_type => "twitter"
     document_id => "%{[@metadata][_id]}"
   }
   stdout {
     codec => "dots"
   }
}

```

Any ideas on if this can be made to work with index-templates ?

Thanks

Ramdev

---

<div class="post-metadata">

### Author: ![jfairchild](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jfairchild/32/4730_2.png) [@jfairchild](https://discuss.elastic.co/u/jfairchild)
#### Post date: [September 17, 2015, 10:32pm UTC](https://discuss.elastic.co/t/using-logstash-to-reindex-elasticsearch/29493/2 "2015-09-17T22:32:43Z")

</div>

I believe the docs say that index\_type has been deprecated in favor of document\_type, so replacing index\_type with document\_type should fix that problem. 😄

---

<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 6, 2017, 5:28am UTC](https://discuss.elastic.co/t/using-logstash-to-reindex-elasticsearch/29493/3 "2017-07-06T05:28:46Z")

</div>


