Skip to content

Instantly share code, notes, and snippets.

@s1s1ty
Created December 27, 2018 15:23
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 s1s1ty/4ad865f2fea91bea090a33dca5f0422f to your computer and use it in GitHub Desktop.
Save s1s1ty/4ad865f2fea91bea090a33dca5f0422f to your computer and use it in GitHub Desktop.
export elastic to csv
input {
elasticsearch {
hosts => "localhost:9200"
index => "give_index_name"
query => '
{
"query": {
"match_all": {}
}
}
'
}
}
output {
csv {
# elastic field name
fields => ["field1", "field2", "field3", "field4", "field5"]
# This is path where we store output.
path => "/scrap/csv-export.csv"
}
}
filter {
mutate {
convert => {
"lat" => "float"
"lon" => "float"
"weight" => "float"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment