Created
August 26, 2014 23:53
-
-
Save jaytaylor/cf32a3ef68c1b5727814 to your computer and use it in GitHub Desktop.
Elasticsearch document sum counter for a set of indices matching a particular pattern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| pattern='' | |
| host='localhost:9200' | |
| expr $( | |
| curl --fail --silent http://${host}/_cat/indices?v | \ | |
| sed 's/ \{1,\}/ /g' | \ | |
| grep " ${pattern}.*" | \ | |
| cut -d' ' -f5 | \ | |
| tr '\n' '+' | \ | |
| sed 's/+$//' | \ | |
| sed 's/+/ + /g' | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment