Check cluster health elasticsearch
Show cluster status: green/yellow/red with shard counts
curl -s http://es:9200/_cluster/health?pretty
more elasticsearch
all 19 commands →
List indices with size
curl -s 'http://es:9200/_cat/indices?v&s=store.size:desc'
Delete old index
curl -X DELETE http://es:9200/logs-2024.01.01
Search with query DSL
curl -X GET 'http://es:9200/logs-*/_search?pretty' -H 'Content-Type: application/json' -d '{"query":{"match":{"level":"error"}},"size":5}'
Show shards allocation
curl -s 'http://es:9200/_cat/shards?v&h=index,shard,prirep,state,node,unassigned.reason'
Force shard re-allocation
curl -X POST http://es:9200/_cluster/reroute?retry_failed=true