es2csv | Export from an Elasticsearch into a CSV file | CSV Processing library
kandi X-RAY | es2csv Summary
kandi X-RAY | es2csv Summary
Export from an Elasticsearch into a CSV file
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Perform a search query
- Write hit list to file
- Retry decorator
- Write the results to a csv file
- Get the version string
- Check if index_prefixes is set
- Creates elasticsearch connection
- Get the description
- Remove all scroll ids
- Read a file
es2csv Key Features
es2csv Examples and Code Snippets
for line in open(self.tmp_file, 'r', encoding='utf-8'):
Community Discussions
Trending Discussions on es2csv
QUESTION
A month ago I encountered this Github: https://github.com/taraslayshchuk/es2csv
I installed this package via pip3 in Linux ubuntu. When I wanted to use this package, I encountered the problem that this package is meant for python2. I dived into the code and soon I found the problem.
...ANSWER
Answered 2017-Jun-06 at 22:00It's due to the default behaviour of open
in Python 3. By default, Python 3 will open files in Text mode, which means that it also has to apply a text decoding, such as utf-8 or ASCII, for every character it reads.
Python will use your locale to determine the most suitable encoding. On OS X and Linux, this is usually UTF-8. On Windows, it'll use an 8-bit character set, such windows-1252, to match the behaviour of Notepad.
As an 8-bit character set only has a limited number of characters, it's very easy to end up trying to write a character not supported by the character set. For example, if you tried to write a Hebrew character with Windows-1252, the Western European character set.
To resolve your problem, you simply need to override the automatic encoding selection in open
and hardcode it to use UTF-8:
QUESTION
Could you please suggest what i am doing wrong? i cannot change the delimiter of the output file using es2csv cli tool.
...ANSWER
Answered 2018-Aug-23 at 09:28Actually this issue has been reported here: https://github.com/taraslayshchuk/es2csv/issues/51
If you don't want to wait for the fix to be released, you can change line 212 of es2csv.py
like this and it will work:
QUESTION
Any ideas on how to export the entire database in elastic search in csv? I just need one index to be exported.
I tried the following python plugin but elastic search as a service provider is complaining on root certificates:
https://github.com/taraslayshchuk/es2csv/blob/master/README.rst
es2csv -i leads -a user:password -u https://host.us-east-1.aws.found.io:9243 -q '' -o database.csv
but I get: elasticsearch.exceptions.ImproperlyConfigured: Root certificates are missing for certificate validation. Either pass them in using the ca_certs parameter or install certifi to use it automatically.
help? I'm using Elasticsearch.co as a service for my elastic search
...ANSWER
Answered 2017-Mar-26 at 19:13You can use Logstash to export an index to CSV:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install es2csv
You can use es2csv like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page