# Logstash to Re-index Elasticsearch indexes

**URL:** <https://discuss.elastic.co/t/logstash-to-re-index-elasticsearch-indexes/26365>\
**Category:** Logstash\
**Created:** [July 27, 2015, 7:36pm UTC](https://discuss.elastic.co/t/logstash-to-re-index-elasticsearch-indexes/26365 "2015-07-27T19:36:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [July 27, 2015, 7:36pm UTC](https://discuss.elastic.co/t/logstash-to-re-index-elasticsearch-indexes/26365/1 "2015-07-27T19:36:00Z")

</div>

I am trying to re-index all the results in my elasticsearch by using Logstash Elasticsearch input and then some filter and then Logstash Elasticsearch Output plugins. For this I created a logstash-elastic.conf file.

If not running as a service I can explicitly give the command. /logstash-1.5.2/bin/logstash -t -f ./logstash-1.5.2/conf.d/logstash-elastic.conf.

How to run only this specific config file while running Logstash as a service.? Because I have to do the same thing in production where Logstahs runs as as service.

---

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [July 27, 2015, 8:35pm UTC](https://discuss.elastic.co/t/logstash-to-re-index-elasticsearch-indexes/26365/2 "2015-07-27T20:35:58Z")

</div>

Here is my config file

```
input {  
      elasticsearch {
       hosts => "10.9.32.112"   
       index => "logstash-2015.07.*"      
       scroll => "5m"
       query => '{"query": {"match":{"_type": "debatetable"}}}'
      }
    }
    filter{
     if [type] == "debatetable" {
            translate {
                field => "contentId"
                destination => "slideName"
                dictionary_path => "/home/logstash-1.5.2/slideNames.yaml"
            }
            translate {
                field => "contentId"
                destination => "caseName"
                dictionary_path => "/home/logstash-1.5.2/caseNames.yaml"
            }
        }
    }
    output {
     if "_grokparsefailure" not in [tags]{
        if [type] == "debatetable" {
        elasticsearch {
                host => "10.9.32.112"
                port => "9200"
                protocol => "http"
                document_type => "debatetableNew"
               }
        }
        stdout {codec => rubydebug}
     }
    }
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 27, 2015, 8:42pm UTC](https://discuss.elastic.co/t/logstash-to-re-index-elasticsearch-indexes/26365/3 "2015-07-27T20:42:29Z")

</div>

When run as a service (daemon) Logstash is usually configured to read all the configuration files from /etc/logstash/conf.d. Just make sure your logstash-elastic.conf file is stored in that directory (and no other files).

---

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [July 28, 2015, 6:59pm UTC](https://discuss.elastic.co/t/logstash-to-re-index-elasticsearch-indexes/26365/4 "2015-07-28T18:59:27Z")

</div>

This works. Thanks

---

<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:33am UTC](https://discuss.elastic.co/t/logstash-to-re-index-elasticsearch-indexes/26365/5 "2017-07-06T05:33:34Z")

</div>


