get-settings.asciidoc 2.6 KB

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