cat APIs
Introduction
All the cat commands accept a query string parameter help to see all the headers and info they provide, and the /_cat command alone lists all the available commands.
Common parameters
- Verbose -
curl -X GET "localhost:9200/_cat/master?v&pretty"
- Help -
curl -X GET "localhost:9200/_cat/master?help&pretty"
- Headers -
curl -X GET "localhost:9200/_cat/nodes?h=ip,port,heapPercent,name&pretty"
- Numeric formats -
curl 'localhost:9200/_cat/indices?bytes=b' | sort -rnk8
- Response as text, json, smile, yaml or cbor -
curl 'localhost:9200/_cat/indices?format=json&pretty'
- Sort -
curl -X GET "localhost:9200/_cat/templates?v&s=order:desc,index_patterns&pretty"
cat aliases
curl -X GET "localhost:9200/_cat/aliases?v&pretty"
cat allocation
curl -X GET "localhost:9200/_cat/allocation?v&pretty"
cat count
curl -X GET "localhost:9200/_cat/count?v&pretty"
curl -X GET "localhost:9200/_cat/count/twitter?v&pretty"
cat fielddata
curl -X GET "localhost:9200/_cat/fielddata?v&pretty"
cat health
curl -X GET "localhost:9200/_cat/health?v&pretty"
cat indices
curl -X GET "localhost:9200/_cat/indices?pretty"
Apply Filter
curl -X GET "localhost:9200/_cat/indices/twi*?pretty"
cat un healthy index
indices which are not ready
curl -X GET "localhost:9200/_cat/indices?v&health=yellow&pretty"
sort by dock count
curl -X GET "localhost:9200/_cat/indices?v&s=docs.count:desc&pretty"
cat master
curl -X GET "localhost:9200/_cat/master?v&pretty"
cat nodes
curl -X GET "localhost:9200/_cat/nodes?v&pretty"
cat pending tasks
curl -X GET "localhost:9200/_cat/pending_tasks?v&pretty"
cat plugins
curl -X GET "localhost:9200/_cat/plugins?v&s=component&h=name,component,version,description&pretty"
cat recovery
curl -X GET "localhost:9200/_cat/recovery?v&pretty"
cat repositories
curl -X GET "localhost:9200/_cat/repositories?v&pretty"
cat thread pool
curl -X GET "localhost:9200/_cat/thread_pool?pretty"
for field data visit Documentation
cat shards
curl -X GET "localhost:9200/_cat/shards?pretty"
Reasion for un assigned shared look Documentation
INDEX_CREATED | Unassigned as a result of an API creation of an index.
CLUSTER_RECOVERED | Unassigned as a result of a full cluster recovery.
INDEX_REOPENED | Unassigned as a result of opening a closed index.
DANGLING_INDEX_IMPORTED | Unassigned as a result of importing a dangling index.
NEW_INDEX_RESTORED | Unassigned as a result of restoring into a new index.
EXISTING_INDEX_RESTORED | Unassigned as a result of restoring into a closed index.
REPLICA_ADDED | Unassigned as a result of explicit addition of a replica.
ALLOCATION_FAILED | Unassigned as a result of a failed allocation of the shard.
NODE_LEFT | Unassigned as a result of the node hosting it leaving the cluster.
REROUTE_CANCELLED | Unassigned as a result of explicit cancel reroute command.
REINITIALIZED | When a shard moves from started back to initializing, for example, with shadow replicas.
REALLOCATED_REPLICA | A better replica location is identified and causes the existing replica allocation to be cancelled.
cat segments
this where your data is saved on the FS.
curl -X GET "localhost:9200/_cat/segments?v&pretty"
snapshots
curl -X GET "localhost:9200/_cat/snapshots/repo1?v&s=id&pretty"
templates
curl -X GET "localhost:9200/_cat/templates?v&s=name&pretty"
Top comments (0)