taraslayshchuk / es2csv

Export from an Elasticsearch into a CSV file
Apache License 2.0
510 stars 191 forks source link

encode utf-8 characters properly before writing to csv #1

Closed pokab closed 8 years ago

pokab commented 8 years ago

My log lines contained non-ascii characters and newlines, which ES returned as (unicode) escape sequences. These need to be encoded. Fix taken from http://stackoverflow.com/questions/5838605/python-dictwriter-writing-utf-8-encoded-csv-files

taraslayshchuk commented 8 years ago

Nice, but this solution breaks another thing:

AttributeError: 'int' object has no attribute 'encode'

Can you fix it, please?

pokab commented 8 years ago

Now it also works with a map which contains non-strings.

taraslayshchuk commented 8 years ago

Can you, please, merge this commits in one?

taraslayshchuk commented 8 years ago

Good job! Thank you!