get-settings.asciidoc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. [[indices-get-settings]]
  2. === Get index settings API
  3. ++++
  4. <titleabbrev>Get index settings</titleabbrev>
  5. ++++
  6. Returns setting information for one or more indices. For data streams, the API
  7. returns setting information for the stream's backing indices.
  8. [source,console]
  9. --------------------------------------------------
  10. GET /my-index-000001/_settings
  11. --------------------------------------------------
  12. // TEST[setup:my_index]
  13. [[get-index-settings-api-request]]
  14. ==== {api-request-title}
  15. `GET /<target>/_settings`
  16. `GET /<target>/_settings/<setting>`
  17. [[get-index-settings-api-prereqs]]
  18. ==== {api-prereq-title}
  19. * If the {es} {security-features} are enabled, you must have the
  20. `view_index_metadata`, `monitor`, or `manage` <<privileges-list-indices,index
  21. privilege>> for the target data stream, index, or alias.
  22. [[get-index-settings-api-path-params]]
  23. ==== {api-path-parms-title}
  24. `<target>`::
  25. (Optional, string) Comma-separated list of data streams, indices, and aliases
  26. used to limit the request. Supports wildcards (`*`). To target all data streams
  27. and indices, omit this parameter or use `*` or `_all`.
  28. `<setting>`::
  29. (Optional, string) Comma-separated list or wildcard expression of setting names
  30. used to limit the request.
  31. [[get-index-settings-api-query-params]]
  32. ==== {api-query-parms-title}
  33. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
  34. +
  35. Defaults to `true`.
  36. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
  37. +
  38. Defaults to `all`.
  39. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=flat-settings]
  40. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=include-defaults]
  41. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
  42. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
  43. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  44. [[get-index-settings-api-example]]
  45. ==== {api-examples-title}
  46. ===== Multiple data streams and indices
  47. The get settings API can be used to get settings for more than one data stream or index with a
  48. single call. To get settings for all indices in a cluster, you can use `_all` or `*` for `<target>`.
  49. Wildcard expressions are also supported. The following are some examples:
  50. [source,console]
  51. --------------------------------------------------
  52. GET /my-index-000001,my-index-000002/_settings
  53. GET /_all/_settings
  54. GET /log_2099_*/_settings
  55. --------------------------------------------------
  56. // TEST[setup:my_index]
  57. // TEST[s/^/PUT my-index-000002\nPUT log_2099_01_01\n/]
  58. ===== Filtering settings by name
  59. The settings that are returned can be filtered with wildcard matching
  60. as follows:
  61. [source,console]
  62. --------------------------------------------------
  63. GET /log_2099_-*/_settings/index.number_*
  64. --------------------------------------------------
  65. // TEST[continued]