I am attempting to capture a list of all the indexes and their sizes in a way that I could capture the information using Angular's $http service and then iterate through the information using the ng-repeat preferably with something like:
<ul ng-repeat="elsindex in elsIndexHttpResponse"> <li>{{elsindex.name}}:{{elsindex.size}}</li> </ul>
The closest thing I have found is this: http://localhost:9200/_cat/indices?h=index,store.size
Except:
a. its responses are not in json so easily referencing it using the ng-repeat <li>
elements isn't going to work; and
b. i would like, if possible, to get the size output to reflect the same unit size (like bytes).
If this involves something complicated then I'd be grateful for pointers on where I should focus.
I am using elasticsearch v1.4.4
Many thanks
Goto Kibana and then click on "Dev Tools" from Left Menu, Once the console is open run the following command to see size of the given index.
You can query localhost:9200/_status and that will give you a list of indices and information about each.
store. size is the total index size across the cluster, including replicas, and since you have 1 replica configured, it is twice the size of the primary shard.
I realize this question dates already, but wanted to add my 2 cents.
http://localhost:9200/_cat/indices?h=index,store.size&bytes=kb&format=json
Would actually get you exactly what you requested:
Information regarding the size unit was retrieved from cat APIs doc
Possible values for the bytes argument
Information regarding the format was an attempt in Sense, which has some auto-completion features quite useful to detect such options.
Cheers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With