Skip to main content

An adept Python CLI utility designed for querying Elasticsearch and exporting result as a CSV file.

Project description

EsXport

codecov

An adept Python CLI utility designed for querying Elasticsearch and exporting result as a CSV file.

Requirements

  1. This tool should be used with Elasticsearch 8.x version.
  2. You also need >= Python 3.8.x.

Installation

From source:

pip install git+https://github.com/nikhilbadyal/esxport.git

Usage

esxport --help

Arguments

Options:
  -q, --query JSON                Query string in Query DSL syntax.
                                  [required]
  -o, --output-file PATH          CSV file location.  [required]
  -i, --index-prefixes TEXT       Index name prefix(es).  [required]
  -u, --url URL                   Elasticsearch host URL.  [default:
                                  https://localhost:9200]
  -U, --user TEXT                 Elasticsearch basic authentication user.
                                  [default: elastic]
  -p, --password TEXT             Elasticsearch basic authentication password.
                                  [required]
  -f, --fields TEXT               List of _source fields to present be in
                                  output.  [default: _all]
  -S, --sort ELASTIC SORT         List of fields to sort on in form
                                  <field>:<direction>
  -d, --delimiter TEXT            Delimiter to use in CSV file.  [default: ,]
  -m, --max-results INTEGER       Maximum number of results to return.
                                  [default: 10]
  -s, --scroll-size INTEGER       Scroll size for each batch of results.
                                  [default: 100]
  -e, --meta-fields [_id|_index|_score]
                                  Add meta-fields in output.
  --verify-certs                  Verify SSL certificates.
  --ca-certs PATH                 Location of CA bundle.
  --client-cert PATH              Location of Client Auth cert.
  --client-key PATH               Location of Client Cert Key.
  -v, --version                   Show version and exit.
  --debug                         Debug mode on.
  --help                          Show this message and exit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

esxport-8.9.0.1.tar.gz (796.7 kB view details)

Uploaded Source

Built Distribution

esxport-8.9.0.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file esxport-8.9.0.1.tar.gz.

File metadata

  • Download URL: esxport-8.9.0.1.tar.gz
  • Upload date:
  • Size: 796.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.3

File hashes

Hashes for esxport-8.9.0.1.tar.gz
Algorithm Hash digest
SHA256 0c645811f6bfaf8f32cf02e1c63adf087be372294b3102923f905418cb7f747c
MD5 e6ceddccb9d1197b844f7f40251f6ea3
BLAKE2b-256 65b69b76182d00f20a5630d5168408779028e477ebc80b1142aebf2740baefd0

See more details on using hashes here.

File details

Details for the file esxport-8.9.0.1-py3-none-any.whl.

File metadata

  • Download URL: esxport-8.9.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.3

File hashes

Hashes for esxport-8.9.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de66e74b395bfda2aba7b1758094ee0ceef6dc80fe01389aee24cb82762d499f
MD5 7af172e5025bd80322f20f4f1c0bdf79
BLAKE2b-256 3fd05f321d83005f00ab6667ba944107dfb1fef56f8116b16f42e979b6c43567

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page