taraslayshchuk / es2csv

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

ElasticSearch 7.0 Compatiblity #71

Open gboddin opened 5 years ago

gboddin commented 5 years ago

This code might only work for ES 7 rn though.

The app should also follow ES versioning I guess.

wolfgang-azevedo commented 5 years ago

@gboddin Hi Mr.!

I'm running ES 7.1 and after changing I've got a new error. Do you have any idea?

Traceback (most recent call last): File "es2csv_cli.py", line 59, in main() File "es2csv_cli.py", line 53, in main es.search_query() File "/opt/es2csv/es2csv.py", line 26, in f_retry return f(args, kwargs) File "/opt/es2csv/es2csv.py", line 126, in search_query res = self.es_conn.search(search_args) File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/utils.py", line 73, in _wrapped return func(args, params=params, **kwargs) TypeError: search() got an unexpected keyword argument '_source_includes'

wolfgang-azevedo commented 5 years ago

Hi @gboddin After commented the following lines (as I don't want to query all indexes) I was able to get the docs....

  if '_all' not in self.opts.fields:
         search_args['_source_includes'] = self.opts.fields

But......., i got a message regarding the search.max_open_scroll_context limit 500. I increased the value....

kirbysu commented 3 years ago

i cannot find the file requirements.txt , can i know where its ? i am use ubuntu 18.04 install es2csv and es7.7.1

gboddin commented 3 years ago

For further readers, I made a Golang version that supports multiple versions including through Kibana. https://github.com/LeakIX/estk .

It only outputs JSON, but should be easy to convert with jq or similar.

whua3 commented 1 year ago

pip list | grep elasticsearch pip uninstall elasticsearch pip install elasticsearch==7.10.0 (my ES version)