get-settings.asciidoc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 index alias.
  22. [[get-index-settings-api-path-params]]
  23. ==== {api-path-parms-title}
  24. `<target>`::
  25. (Optional, string)
  26. Comma-separated list of data streams, indices, and index aliases used to limit
  27. the request. Wildcard expressions (`*`) are supported.
  28. +
  29. To target all data streams and indices in a cluster, omit this parameter or use
  30. `_all` or `*`.
  31. `<setting>`::
  32. (Optional, string) Comma-separated list or wildcard expression of setting names
  33. used to limit the request.
  34. [[get-index-settings-api-query-params]]
  35. ==== {api-query-parms-title}
  36. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
  37. +
  38. Defaults to `true`.
  39. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
  40. +
  41. Defaults to `all`.
  42. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=flat-settings]
  43. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=include-defaults]
  44. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
  45. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
  46. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  47. [[get-index-settings-api-example]]
  48. ==== {api-examples-title}
  49. ===== Multiple data streams and indices
  50. The get settings API can be used to get settings for more than one data stream or index with a
  51. single call. To get settings for all indices in a cluster, you can use `_all` or `*` for `<target>`.
  52. Wildcard expressions are also supported. The following are some examples:
  53. [source,console]
  54. --------------------------------------------------
  55. GET /my-index-000001,my-index-000002/_settings
  56. GET /_all/_settings
  57. GET /log_2099_*/_settings
  58. --------------------------------------------------
  59. // TEST[setup:my_index]
  60. // TEST[s/^/PUT my-index-000002\nPUT log_2099_01_01\n/]
  61. ===== Filtering settings by name
  62. The settings that are returned can be filtered with wildcard matching
  63. as follows:
  64. [source,console]
  65. --------------------------------------------------
  66. GET /log_2099_-*/_settings/index.number_*
  67. --------------------------------------------------
  68. // TEST[continued]