Created
December 27, 2018 15:23
-
-
Save s1s1ty/4ad865f2fea91bea090a33dca5f0422f to your computer and use it in GitHub Desktop.
export elastic to csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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