Skip to content

Commit 518d71d

Browse files
authored
[DOCS] Document hidden data streams and naming restrictions (#65862)
1 parent 4568082 commit 518d71d

8 files changed

+86
-25
lines changed

docs/reference/api-conventions.asciidoc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,19 @@ NOTE: Single index APIs, such as the <<docs>> and
5252
syntax.
5353

5454
[[hidden-indices]]
55-
==== Hidden indices
55+
==== Hidden data streams and indices
5656

57-
Indices that are configured to be hidden with the <<index-hidden,index.hidden>> setting are
58-
excluded from mult-target queries by default.
59-
To include hidden indices, you must specify the `expand_wildcards` parameter.
57+
For most APIs, wildcard expressions do not match hidden data streams and indices
58+
by default. To match hidden data streams and indices using a wildcard
59+
expression, you must specify the `expand_wildcards` query parameter.
6060

61-
The backing indices for data streams are hidden indices,
62-
and some features like {ml} store information in hidden indices.
61+
You can create hidden data streams by setting
62+
<<data-stream-hidden,`data_stream.hidden`>> to `true` in the stream's matching
63+
index template. You can hide indices using the <<index-hidden,`index.hidden`>>
64+
index setting.
65+
66+
The backing indices for data streams are hidden automatically. Some features,
67+
such as {ml}, store information in hidden indices.
6368

6469
Global index templates that match all indices are not applied to hidden indices.
6570

docs/reference/data-streams/set-up-a-data-stream.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ PUT /_ilm/policy/my-data-stream-policy
6666
template is used for data streams.
6767
. Use the wizard to finish defining your template. Specify:
6868

69-
* One or more index patterns that match the data stream's name.
69+
* One or more index patterns that match the data stream's name. +
70+
include::{es-repo-dir}/indices/create-data-stream.asciidoc[tag=data-stream-name]
7071

7172
* Mappings and settings for the stream's backing indices.
7273

@@ -94,7 +95,6 @@ maps `@timestamp` as a `date` field with default options.
9495

9596
If using {ilm-init}, specify your lifecycle policy in the `index.lifecycle.name`
9697
setting.
97-
9898
TIP: Carefully consider your template's mappings and settings. Later changes may
9999
require reindexing. See <<data-streams-change-mappings-and-settings>>.
100100

@@ -105,7 +105,7 @@ image::images/data-streams/create-index-template.png[Create template page]
105105
.API example
106106
====
107107
Use the <<indices-put-template,put index template API>> to create an index
108-
template. The template must include an empty `data_stream` object, indicating
108+
template. The template must include a `data_stream` object, indicating
109109
it's used for data streams.
110110
111111
[source,console]

docs/reference/indices/create-data-stream.asciidoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,16 @@ DELETE /_index_template/template
4949
--
5050
(Required, string) Name of the data stream to create.
5151

52+
// tag::data-stream-name[]
5253
Data stream names must meet the following criteria:
5354

5455
- Lowercase only
55-
- Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, ` ` (space character),
56-
`,`, `#`, `:`
57-
- Cannot start with `-`, `_`, `+`, `.`
56+
- Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, `#`, `:`, or a
57+
space character
58+
- Cannot start with `-`, `_`, `+`, or `.ds-`
5859
- Cannot be `.` or `..`
59-
- Cannot be longer than 255 bytes (note it is bytes, so multi-byte characters
60-
will count towards the 255 limit faster)
60+
- Cannot be longer than 255 bytes. Multi-byte characters
61+
count towards this limit faster.
62+
// end::data-stream-name[]
6163
--
6264

docs/reference/indices/data-stream-stats.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ To target all data streams in a cluster, omit this parameter or use `*`.
7272
[[data-stream-stats-api-query-params]]
7373
==== {api-query-parms-title}
7474

75+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=ds-expand-wildcards]
76+
+
77+
Defaults to `open`.
78+
7579
`human`::
7680
(Optional, Boolean)
7781
If `true`, the response includes statistics in human-readable <<byte-units,byte

docs/reference/indices/delete-data-stream.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,11 @@ DELETE /_index_template/template
4848
(Required, string)
4949
Comma-separated list of data streams to delete.
5050
Wildcard (`*`) expressions are supported.
51+
52+
[role="child_attributes"]
53+
[[delete-data-stream-api-query-parms]]
54+
==== {api-query-parms-title}
55+
56+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=ds-expand-wildcards]
57+
+
58+
Defaults to `open`.

docs/reference/indices/get-data-stream.asciidoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ Comma-separated list of data stream names used to limit the request. Wildcard
8484
(`*`) expressions are supported. If omitted, all data streams will be
8585
returned.
8686

87+
[role="child_attributes"]
88+
[[get-data-stream-api-query-parms]]
89+
==== {api-query-parms-title}
90+
91+
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=ds-expand-wildcards]
92+
+
93+
Defaults to `open`.
94+
8795
[role="child_attributes"]
8896
[[get-data-stream-api-response-body]]
8997
==== {api-response-body-title}
@@ -184,6 +192,10 @@ included in the response.
184192
NOTE: A data stream's backing indices may be assigned different lifecycle
185193
policies. To retrieve the lifecycle policy for individual backing indices,
186194
use the <<indices-get-settings,get index settings API>>.
195+
196+
`hidden`::
197+
(Boolean)
198+
If `true`, the data stream is <<hidden-indices,hidden>>.
187199
====
188200

189201
[[get-data-stream-api-example]]

docs/reference/indices/put-index-template.asciidoc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,20 @@ your template is applied instead of the built-in template for `logs-*-*`.
103103

104104
[xpack]#`data_stream`#::
105105
(Optional, object)
106-
Indicates whether the template is used to create data streams and their backing
107-
indices. If so, use an empty object as the argument: +
108-
`data_stream: { }`.
106+
If this object is included, the template is used to create data streams and
107+
their backing indices. Supports an empty object: `data_stream: { }`
109108
+
110109
Data streams require a matching index template with a `data_stream` object.
111110
See <<create-a-data-stream-template>>.
111+
+
112+
.Properties of `data_stream`
113+
[%collapsible%open]
114+
====
115+
[[data-stream-hidden]]
116+
`hidden`::
117+
(Optional, Boolean)
118+
If `true`, the data stream is <<hidden-indices,hidden>>. Defaults to `false`.
119+
====
112120

113121
`template`::
114122
(Optional, object)

docs/reference/rest-api/common-parms.asciidoc

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,26 +205,48 @@ Enrich policy name
205205
used to limit the request.
206206
end::enrich-policy[]
207207

208+
tag::ds-expand-wildcards[]
209+
`expand_wildcards`::
210+
+
211+
--
212+
(Optional, string)
213+
Type of data stream that wildcard expressions can match. Supports
214+
comma-separated values, such as `open,hidden`. Valid values are:
215+
216+
`all`, `hidden`::
217+
Match any data stream, including <<hidden-indices,hidden>> ones.
218+
219+
`open`, `closed`::
220+
Matches any non-hidden data stream. Data streams cannot be closed.
221+
222+
`none`::
223+
Wildcard expressions are not accepted.
224+
--
225+
end::ds-expand-wildcards[]
226+
208227
tag::expand-wildcards[]
209228
`expand_wildcards`::
210229
+
211230
--
212-
(Optional, string) Controls what kind of indices that wildcard expressions can
213-
expand to. Multiple values are accepted when separated by a comma, as in
214-
`open,hidden`. Valid values are:
231+
(Optional, string)
232+
Type of index that wildcard expressions can match. If the request can target
233+
data streams, this argument determines whether wildcard expressions match
234+
hidden data streams. Supports comma-separated values, such as `open,hidden`.
235+
Valid values are:
215236

216237
`all`::
217-
Expand to open and closed indices, including <<hidden-indices,hidden indices>>.
238+
Match any data stream or index, including <<hidden-indices,hidden>> ones.
218239

219240
`open`::
220-
Expand only to open indices.
241+
Match open, non-hidden indices. Also matches any non-hidden data stream.
221242

222243
`closed`::
223-
Expand only to closed indices.
244+
Match closed, non-hidden indices. Also matches any non-hidden data stream. Data
245+
streams cannot be closed.
224246

225247
`hidden`::
226-
Expansion of wildcards will include hidden indices.
227-
Must be combined with `open`, `closed`, or both.
248+
Match hidden data streams and hidden indices. Must be combined with `open`,
249+
`closed`, or both.
228250

229251
`none`::
230252
Wildcard expressions are not accepted.

0 commit comments

Comments
 (0)