Skip to content

Instantly share code, notes, and snippets.

@markwalkom
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markwalkom/f47a30e37cd402f2dc5d to your computer and use it in GitHub Desktop.
Save markwalkom/f47a30e37cd402f2dc5d to your computer and use it in GitHub Desktop.
Export from ES to a json file
input {
elasticsearch {
hosts => [ "HOSTNAME_HERE" ]
port => "9200"
index => "INDEXNAME_HERE"
size => 500
scroll => "5m"
}
}
output {
file {
path => "/path/to/output-file.json"
codec => "json"
}
}
# As a single input line for Logstash, eg: logstash -e ....
input { elasticsearch { hosts => [ "HOSTNAME_HERE" ] port => "9200" index => "INDEXNAME_HERE" size => 500 scroll => "5m" } } output { file { path => "/path/to/output-file.json" codec => "json"} }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment