Skip to content

Instantly share code, notes, and snippets.

@sergey-alekseev
Last active August 17, 2022 09:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergey-alekseev/b3edf7702a86b72c05ed8e65fb257cd0 to your computer and use it in GitHub Desktop.
Save sergey-alekseev/b3edf7702a86b72c05ed8e65fb257cd0 to your computer and use it in GitHub Desktop.
input {
# Read all documents from Elasticsearch matching the given query
elasticsearch {
hosts => "localhost"
index => "index_name"
query => '{"query":{"regexp":{"not_analyzed_field":".*"}}}'
}
}
output {
csv {
fields => ["_id", "_type", "field"]
path => "/home/sergey/export.csv"
}
}
@aymenoss
Copy link

hello,
how can I export all the indexes one time.

@aymenoss
Copy link

In case if I want update the elasticsearch version, How can I keep the indexes ?
thanks

@PhanNN
Copy link

PhanNN commented Aug 17, 2022

hello, how can I export all the indexes one time.

You can use regex for index like index => "*-suffix"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment