Coder Social home page Coder Social logo

Comments (1)

taraslayshchuk avatar taraslayshchuk commented on May 26, 2024

I am not sure what locale.Error: unsupported locale setting error means, but es2csv perfectly installable on ubuntu 16.04 and python 2.7.12, pip 8.1.1 for me:

root@31797658fb91:/# cat /etc/issue
Ubuntu 16.04.4 LTS \n \l

root@31797658fb91:/# python --version
Python 2.7.12
root@31797658fb91:/# pip --version
pip 8.1.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
root@31797658fb91:/# pip install es2csv
Collecting es2csv
  Downloading es2csv-5.2.1-py27-none-any.whl
Collecting progressbar2<3.11.0,>=3.10.0 (from es2csv)
  Downloading progressbar2-3.10.1-py2.py3-none-any.whl
Collecting elasticsearch<5.3.0,>=5.2.0 (from es2csv)
  Downloading elasticsearch-5.2.0-py2.py3-none-any.whl (57kB)
    100% |################################| 61kB 1.2MB/s 
Collecting python-utils>=2.0.0 (from progressbar2<3.11.0,>=3.10.0->es2csv)
  Downloading python_utils-2.3.0-py2.py3-none-any.whl
Collecting urllib3<2.0,>=1.8 (from elasticsearch<5.3.0,>=5.2.0->es2csv)
  Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
    100% |################################| 133kB 1.6MB/s 
Collecting six (from python-utils>=2.0.0->progressbar2<3.11.0,>=3.10.0->es2csv)
  Downloading six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, python-utils, progressbar2, urllib3, elasticsearch, es2csv
Successfully installed elasticsearch-5.2.0 es2csv-5.2.1 progressbar2-3.10.1 python-utils-2.3.0 six-1.11.0 urllib3-1.22
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@31797658fb91:/# es2csv --help
usage: es2csv [-h] -q QUERY [-u URL] [-a AUTH] [-i INDEX [INDEX ...]]
              [-D DOC_TYPE [DOC_TYPE ...]] [-t TAGS [TAGS ...]] -o FILE
              [-f FIELDS [FIELDS ...]] [-d DELIMITER] [-m INTEGER]
              [-s INTEGER] [-k] [-r] [-e] [--verify-certs]
              [--ca-certs CA_CERTS] [--client-cert CLIENT_CERT]
              [--client-key CLIENT_KEY] [-v] [--debug]

title:           A CLI tool for exporting data from Elasticsearch into a CSV file.
description:     Command line utility, written in Python, for querying Elasticsearch in Lucene query syntax or Query DSL syntax and exporting result as documents into a CSV file.
usage:           es2csv -q '*' -i _all -e -o ~/file.csv -k -m 100
                 es2csv -q '{"query": {"match_all": {}}}' -r -i _all -o ~/file.csv
                 es2csv -q @'~/long_query_file.json' -r -i _all -o ~/file.csv
                 es2csv -q '*' -i logstash-2015-01-* -f host status message -o ~/file.csv
                 es2csv -q 'host: localhost' -i logstash-2015-01-01 logstash-2015-01-02 -f host status message -o ~/file.csv
                 es2csv -q 'host: localhost AND status: GET' -u http://kibana.com:80/es/ -o ~/file.csv
                 es2csv -q '*' -t dev prod -u http://login:[email protected]:6666/es/ -o ~/file.csv
                 es2csv -q '{"query": {"match_all": {}}, "filter":{"term": {"tags": "dev"}}}' -r -u http://login:[email protected]:6666/es/ -o ~/file.csv

optional arguments:
  -h, --help            show this help message and exit
  -q QUERY, --query QUERY
                        Query string in Lucene syntax.
  -u URL, --url URL     Elasticsearch host URL. Default is
                        http://localhost:9200.
  -a AUTH, --auth AUTH  Elasticsearch basic authentication in the form of
                        username:password.
  -i INDEX [INDEX ...], --index-prefixes INDEX [INDEX ...]
                        Index name prefix(es). Default is ['logstash-*'].
  -D DOC_TYPE [DOC_TYPE ...], --doc_types DOC_TYPE [DOC_TYPE ...]
                        Document type(s).
  -t TAGS [TAGS ...], --tags TAGS [TAGS ...]
                        Query tags.
  -o FILE, --output_file FILE
                        CSV file location.
  -f FIELDS [FIELDS ...], --fields FIELDS [FIELDS ...]
                        List of selected fields in output. Default is
                        ['_all'].
  -d DELIMITER, --delimiter DELIMITER
                        Delimiter to use in CSV file. Default is ",".
  -m INTEGER, --max INTEGER
                        Maximum number of results to return. Default is 0.
  -s INTEGER, --scroll_size INTEGER
                        Scroll size for each batch of results. Default is 100.
  -k, --kibana_nested   Format nested fields in Kibana style.
  -r, --raw_query       Switch query format in the Query DSL.
  -e, --meta_fields     Add meta-fields in output.
  --verify-certs        Verify SSL certificates. Default is False.
  --ca-certs CA_CERTS   Location of CA bundle.
  --client-cert CLIENT_CERT
                        Location of Client Auth cert.
  --client-key CLIENT_KEY
                        Location of Client Cert Key.
  -v, --version         Show version and exit.
  --debug               Debug mode on.

from es2csv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.