List all indexes on ElasticSearch server?

前端 未结 23 1147
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 09:55

I would like to list all indexes present on an ElasticSearch server. I tried this:

curl -XGET localhost:9200/

but it just gives me this:

23条回答
  •  甜味超标
    2020-12-12 10:13

    curl -XGET 'http://localhost:9200/_cluster/health?level=indices'

    This will output like below

    {
      "cluster_name": "XXXXXX:name",
      "status": "green",
      "timed_out": false,
      "number_of_nodes": 3,
      "number_of_data_nodes": 3,
      "active_primary_shards": 199,
      "active_shards": 398,
      "relocating_shards": 0,
      "initializing_shards": 0,
      "unassigned_shards": 0,
      "delayed_unassigned_shards": 0,
      "number_of_pending_tasks": 0,
      "number_of_in_flight_fetch": 0,
      "task_max_waiting_in_queue_millis": 0,
      "active_shards_percent_as_number": 100,
      "indices": {
        "logstash-2017.06.19": {
          "status": "green",
          "number_of_shards": 3,
          "number_of_replicas": 1,
          "active_primary_shards": 3,
          "active_shards": 6,
          "relocating_shards": 0,
          "initializing_shards": 0,
          "unassigned_shards": 0
        },
        "logstash-2017.06.18": {
          "status": "green",
          "number_of_shards": 3,
          "number_of_replicas": 1,
          "active_primary_shards": 3,
          "active_shards": 6,
          "relocating_shards": 0,
          "initializing_shards": 0,
          "unassigned_shards": 0
        }}
    

提交回复
热议问题