List indices with size

All indices sorted by store size (largest first)

curl -s 'http://es:9200/_cat/indices?v&s=store.size:desc'

tool
elasticsearch19 commands
tags
elasticsearchmonitoring

More elasticsearch commands

  • curl -X DELETE http://es:9200/logs-2024.01.01

    Remove a specific index (irreversible)

  • curl -X GET 'http://es:9200/logs-*/_search?pretty' -H 'Content-Type: application/json' -d '{"query":{"match":{"level":"error"}},"size":5}'

    Find last 5 error log entries

  • curl -s 'http://es:9200/_cat/shards?v&h=index,shard,prirep,state,node,unassigned.reason'

    Show all shards with their state and unassigned reason

  • curl -X POST http://es:9200/_cluster/reroute?retry_failed=true

    Retry allocation of all failed/unassigned shards

  • curl -X PUT 'http://es:9200/my-index/_settings' -H 'Content-Type: application/json' -d '{"index":{"number_of_replicas":1}}'

    Change replica count on a live index

all 19 elasticsearch commands