私の変種:
import elasticsearch
client = elasticsearch.Elasticsearch()
all_indices = client.indices.stats(metric='store', human=True)['indices'].keys()
dic_indices = {}
for index in all_indices:
size = client.indices.stats(metric='store', human=True)['indices'][index]['total']['store']['size']
dic_indices[index] = size
print dic_indices
結果には次のビューがあります:
{u'haproxy-2016.09.02': u'1.6gb', u'haproxy-2016.09.03': u'827.3mb', u'marathon-2016.09.03': u'296.1mb', u'docker-2016-09-06': u'187.2mb', u'haproxy-2016.09.06': u'339.7mb', u'haproxy-2016.09.04': u'647.5mb', u'haproxy-2016.09.05': u'595.5mb'}