Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting unrecognized parameter: [_source_include] with Elastic 7.3 and using -f to specify fields #76

Open
prashanttct07 opened this issue Nov 15, 2019 · 1 comment

Comments

@prashanttct07
Copy link

after installing es2csv I tried to run it against public ES cluster with version 7.3 and specifying explicit fields to be returned as -f:

es2csv -u https://localhost:9200/ -a user:pwd -i logstash-* -r -q '{"query": {"match_all": {}}}' --verify-certs --ca-certs /etc/logstash/elasticCA.crt -f message -o dump.csv

I get

ge -o dump.csv_3
Traceback (most recent call last):
  File "/usr/local/bin/es2csv", line 11, in <module>
    load_entry_point('es2csv==5.5.2', 'console_scripts', 'es2csv')()
  File "/usr/local/lib/python2.7/dist-packages/es2csv_cli.py", line 53, in main
    es.search_query()
  File "/usr/local/lib/python2.7/dist-packages/es2csv.py", line 26, in f_retry
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/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)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/__init__.py", line 632, in search
    doc_type, '_search'), params=params, body=body)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/transport.py", line 312, in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/connection/http_urllib3.py", line 129, in perform_request
    self._raise_error(response.status, raw_data)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/connection/base.py", line 125, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
elasticsearch.exceptions.RequestError: TransportError(400, u'illegal_argument_exception', u'request [/logstash-*/_search] contains unrecognized parameter: [_source_include] -> did you mean any of [_source_includes, _source_excludes]?')

Is this an issue cause of 7.3 or I am missing something?

@rc9000
Copy link

rc9000 commented Nov 25, 2019

It's fixed by the PR @gboddin provided: #71

Unfortunately you'll have to apply it yourself, or install from https://github.com/gboddin/es2csv/tree/es-7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants