Skip to content

Instantly share code, notes, and snippets.

@sirianni
Last active December 13, 2016 20:56
Show Gist options
  • Save sirianni/adbbafa36251c85e3c0c3fb1f4345e12 to your computer and use it in GitHub Desktop.
Save sirianni/adbbafa36251c85e3c0c3fb1f4345e12 to your computer and use it in GitHub Desktop.
Elasticsearch Query to CSV
curl -v --data @query.json http://localhost:9200/myindex/_search \
| jq --compact-output --raw-output \
'.hits.hits[] | ._source | [.["@timestamp"], .user.login, .user.accountName, .user.class, .user.accountType, .request.urlPath] | @csv'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment