How to Migrate ElasticSearch Data Using Logstash

Steps to Migrate ElasticSearch Using Logstash

input {
ElasticSearch {
hosts => ["********your host**********"]
user => "*******"
password => "*********"
index => "logstash-2017.11.07"
size => 1000
scroll => "1m"
}
}
# a note in this section indicates that filter can be selected
filter {
}
output {
ElasticSearch {
hosts => ["***********your host**************"]
user => "********"
password => "**********"
index => "logstash-2017.11.07"
}
}

Migrating ElasticSearch Data Using Logstash Sample Use Case

input {
ElasticSearch {
hosts => ["yourhost"]
user => "**********"
password => "*********"
index => "*"#This wildcard requires the process to read all index information
size => 1000
scroll => "1m"
codec => "json"
docinfo => true
}
}
# a note in this section indicates that filter can be selected
filter {
}
output {
ElasticSearch {
hosts => ["yourhost"]
user => "********"
password => "********"
index => "%{[@metadata][_index]}"
}
stdout { codec => rubydebug { metadata => true } }
}

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store