Skip to content

Commit

Permalink
Merge pull request #9 from pteich/export-formats
Browse files Browse the repository at this point in the history
Support multiple output formats
  • Loading branch information
pteich authored Nov 27, 2021
2 parents bac8287 + cef4663 commit f4192e5
Show file tree
Hide file tree
Showing 9 changed files with 375 additions and 247 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BINARY=es-query-csv
VERSION=1.3.1
VERSION=v1.4.0
BUILD_TIME=`date +%FT%T%z`
GOX_OSARCH="darwin/amd64 darwin/arm64 linux/386 linux/amd64 windows/386 windows/amd64"

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ es-query-export -c "http://localhost:9200" -i "logstash-*" --startdate="2019-04-
| `-q --query` | | Lucene query to match documents (same as in Kibana) |
| ` --fields` | | define a comma separated list of fields to export |
| `-o --outfile` | output.csv | name of output file |
| `-f --outformat` | csv | format of the output data: possible values csv, json, raw |
| `-r --rawquery`| | optional raw ElasticSearch query JSON string |
| `-s --start` | | optional start date - Format: YYYY-MM-DDThh:mm:ss.SSSZ. or any other Elasticsearch default format |
| `-e --end` | | optional end date - Format: YYYY-MM-DDThh:mm:ss.SSSZ. or any other Elasticsearch default format |
| `--timefield` | | optional time field to use, default to @timestamp |
| `--verifySSL` | true | optional define how to handle SSL certificates |
| `--user` | | optional username |
| `--pass` | | optional password |

## Output Formats

- `csv` - all or selected fields separated by comma (,)
- `json` - all or selected fields as JSON objects, one per line
- `raw` - JSON dump of matching documents including id, index and _source field containing the document data. One document as JSON object per line.
238 changes: 0 additions & 238 deletions export.go

This file was deleted.

Loading

0 comments on commit f4192e5

Please sign in to comment.