Reputation: 225
Is there any way to know the size of index programmatically .Right now I am trying URL "http://localhost:9200/_cat/indices?h=index,store.size"
which give size upto one decimal (For eg it gives 2.6 for both 2.60 and 2.66). I want size upto two decimal.Kindly suggest some points.
Upvotes: 0
Views: 338
Reputation: 217254
A simple way to achieve what you need is to ask for the size in bytes, so you have full precision, simply append ...&bytes=b
at the end of your URL, like this:
curl 'http://localhost:9200/_cat/indices?h=index,store.size&bytes=b'
You'll get a response like this:
index1 37224042277
index2 5864821948
index3 6964380398
Upvotes: 4