dishatkr
dishatkr

Reputation: 51

How do i know how much data is stored in my Elastic search?

I want to know how much data is stored in my Elastic search.

I m exploring the cluster-stats API.

https://www.elastic.co/guide/en/elasticsearch/reference/7.9/cluster-stats.html Does "store" -> size_in_bytes , show the size of data stored ?

Upvotes: 5

Views: 1320

Answers (1)

Seasers
Seasers

Reputation: 546

yes, using Cluster stats API, size_in_bytes in 'store' represents the total size, in bytes, of all shards assigned to selected nodes.

Statistics can be also returned in a format suitable for humans adding human=true in the request, for example:

http://localhost:9200/_cluster/stats?human=true
"store": {
            "size": "93.7mb",
            "size_in_bytes": 98292482,
            "total_data_set_size": "93.7mb",
            "total_data_set_size_in_bytes": 98292482,
            "reserved": "0b",
            "reserved_in_bytes": 0
        },

You can also use cat allocation API to get used and available disk space for each node and disk space used by the node’s shards (disk.indices):

http://localhost:9200/_cat/allocation?v

If you are interested in knowing the store size for each index in a cluster, you can use the cat indices API:

http://localhost:9200/_cat/indices?v

Upvotes: 4

Related Questions