Last active
August 5, 2016 10:03
-
-
Save mitallast/afaf372473c254b94038c7953fd44d83 to your computer and use it in GitHub Desktop.
recovery.py index-name-1 index-name-2
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
| from elasticsearch import Elasticsearch | |
| import sys | |
| indexes = sys.argv[1:] | |
| client = Elasticsearch('host:port') | |
| recovery = client.indices.recovery(",".join(indexes), human=True) | |
| for index, state in recovery.items(): | |
| print "index: {}".format(index) | |
| for shard in state['shards']: | |
| print "shard: {:<2}".format(shard['id']), | |
| print "size: {:<6}".format(shard['index']['size']['percent']), | |
| print "files: {:<6}".format(shard['index']['files']['percent']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment