Skip to content

elasticsearch get-index-settings

Get elastic search index settings

Description

Get settings info for one or more indices

Synopsis

elasticsearch get-index-settings
    [--site <site>]
    [--cluster <cluster>]
    [--filter_path <filter_path>]
    <index>
    [--settings <settings>]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

cluster - (string)

     Name of elastic search cluster
     Example: --cluster "elastic-default"
     Default: elastic-default      Attributes: optional

filter_path - (string)

     Path in the response. Filters and returns only parts of response matching this path
     Example: --filter_path "index.mappings.properties.*"
     Default: _None_      Attributes: optional, multiple allowed

index - (string)

     Name of indices (also supports wild card expression)
     Example: "students,class / _all / log_2099_*"
     Default: _None_      Attributes: required, multiple allowed

settings - (string)

     List or wildcard expression of setting names to filter the request
     Example: --settings "index.number_*"
     Default: _None_      Attributes: optional, multiple allowed

Examples

Input:

! elasticsearch get-index-settings --cluster "elastic-1" "my_source_index" "test"
Output:
{
  "test": {
    "settings": {
      "index": {
        "routing": {
          "allocation": {
            "include": {
              "_tier_preference": "data_content"
            }
          }
        },
        "number_of_shards": "1",
        "provided_name": "test",
        "creation_date": "1633061676252",
        "number_of_replicas": "1",
        "uuid": "vpk0XgasRcGGTfpvF7R-SQ",
        "version": {
          "created": "7140299"
        }
      }
    }
  },
  "my_source_index": {
    "settings": {
      "index": {
        "routing": {
          "allocation": {
            "include": {
              "_tier_preference": "data_content"
            },
            "require": {
              "_name": "shrink_node_name"
            }
          }
        },
        "number_of_shards": "4",
        "blocks": {
          "write": "true"
        },
        "provided_name": "my_source_index",
        "creation_date": "1632834248780",
        "number_of_replicas": "0",
        "uuid": "tkkO4G2UQ_KDXfOUgZVuGQ",
        "version": {
          "created": "7140299"
        }
      }
    }
  }
}
Input:
! elasticsearch get-index-settings --cluster "elastic-1" "my_source_index" --settings "index.number_of_shards" --settings "index.number_of_replicas"
Output:
{
  "my_source_index": {
    "settings": {
      "index": {
        "number_of_shards": "4",
        "number_of_replicas": "0"
      }
    }
  }
}

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "elasticsearch"
Service Instance cluster
Namespace
Object Type "index"
Object ID index

Please see Access Control for details.