pteich / elastic-query-export

🚚 Export Data from ElasticSearch to CSV/JSON using a Lucene Query (e.g. from Kibana) or a raw JSON Query string
MIT License
86 stars 18 forks source link

Support multiple output formats #9

Closed pteich closed 2 years ago

pteich commented 2 years ago

This PR includes some refactoring to support different output formats. It also contains some code clean up and simplifications.

Fixes #8

pteich commented 2 years ago

Added a new CLI flag -f or --outformat that can be one of csv (default), json or raw. CSV and JSON export contains just the data, all or selected fields. In case of JSON it is one object per line. RAW is a special format that does a raw dump of ElasticSearch documents, including metadata fields like _index, _id and so on and the document data in _source.