Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wfxr/elastic-tunnel

Tools for downloading data from elasticsearch
https://github.com/wfxr/elastic-tunnel

Last synced: about 1 month ago
JSON representation

Tools for downloading data from elasticsearch

Awesome Lists containing this project

README

        

# elastic-tunnel

Tools for downloading data from elasticsearch cluster.

## Usage
```
usage: elastic-tunnel -i -q -o [...]
-f,--fields Fields to download
-h,--host Elasticsearch host url
-i,--index Elasticsearch index name
-l,--limit Max entries to download
-o,--output Output format [JSON|CSV]
-p,--pass Elasticsearch user password
--pretty Pretty printing
-q,--query Query file
-s,--slice Elasticsearch Scroll slice
--scroll Elasticsearch scroll timeout
--size Elasticsearch scroll size
-u,--user Elasticsearch user name
```

## Config

Option `host`, `user` and `pass` can be loaded from the config file, eg:
```
ES_HOST=http://192.168.1.1:9200
ES_USER=user
ES_PASS=pass
```

The program will try to read `.ecsonfig` in the working directory at first.
Then try to read `$HOME/.esconfig` if it fails.

## Example

```
elastic-tunnel -i twitter -f id,user -q query.json -o json --pretty
```

`query.json` may like this:

```bash
{
"term": {
"country": "China"
}
}
```

## License

The MIT License ([MIT](https://wfxr.mit-license.org/2019))

Copyright (c) Wenxuan Zhang