Skip to content

Commit f4192e5

Browse files
authored
Merge pull request #9 from pteich/export-formats
Support multiple output formats
2 parents bac8287 + cef4663 commit f4192e5

File tree

9 files changed

+375
-247
lines changed

9 files changed

+375
-247
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
BINARY=es-query-csv
2-
VERSION=1.3.1
2+
VERSION=v1.4.0
33
BUILD_TIME=`date +%FT%T%z`
44
GOX_OSARCH="darwin/amd64 darwin/arm64 linux/386 linux/amd64 windows/386 windows/amd64"
55

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,17 @@ es-query-export -c "http://localhost:9200" -i "logstash-*" --startdate="2019-04-
2626
| `-q --query` | | Lucene query to match documents (same as in Kibana) |
2727
| ` --fields` | | define a comma separated list of fields to export |
2828
| `-o --outfile` | output.csv | name of output file |
29+
| `-f --outformat` | csv | format of the output data: possible values csv, json, raw |
2930
| `-r --rawquery`| | optional raw ElasticSearch query JSON string |
3031
| `-s --start` | | optional start date - Format: YYYY-MM-DDThh:mm:ss.SSSZ. or any other Elasticsearch default format |
3132
| `-e --end` | | optional end date - Format: YYYY-MM-DDThh:mm:ss.SSSZ. or any other Elasticsearch default format |
3233
| `--timefield` | | optional time field to use, default to @timestamp |
3334
| `--verifySSL` | true | optional define how to handle SSL certificates |
3435
| `--user` | | optional username |
3536
| `--pass` | | optional password |
37+
38+
## Output Formats
39+
40+
- `csv` - all or selected fields separated by comma (,)
41+
- `json` - all or selected fields as JSON objects, one per line
42+
- `raw` - JSON dump of matching documents including id, index and _source field containing the document data. One document as JSON object per line.

export.go

Lines changed: 0 additions & 238 deletions
This file was deleted.

0 commit comments

Comments
 (0)