2020-07-09 20:45:13 +08:00
|
|
|
[role="xpack"]
|
2020-05-13 20:51:39 +08:00
|
|
|
[[indices-create-data-stream]]
|
|
|
|
=== Create data stream API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Create data stream</titleabbrev>
|
|
|
|
++++
|
|
|
|
|
2020-06-18 22:46:01 +08:00
|
|
|
Creates a new <<data-streams,data stream>>.
|
2020-05-13 20:51:39 +08:00
|
|
|
|
2021-01-12 01:38:09 +08:00
|
|
|
Data streams require a matching <<index-templates,index template>>.
|
2020-06-18 22:46:01 +08:00
|
|
|
See <<set-up-a-data-stream>>.
|
2020-05-28 19:11:15 +08:00
|
|
|
|
2020-06-18 22:46:01 +08:00
|
|
|
////
|
2020-05-13 20:51:39 +08:00
|
|
|
[source,console]
|
2020-06-18 22:46:01 +08:00
|
|
|
----
|
|
|
|
PUT /_index_template/template
|
2020-05-13 20:51:39 +08:00
|
|
|
{
|
2020-05-28 19:11:15 +08:00
|
|
|
"index_patterns": ["my-data-stream*"],
|
2020-07-15 00:08:54 +08:00
|
|
|
"data_stream": { }
|
2020-05-13 20:51:39 +08:00
|
|
|
}
|
2020-06-18 22:46:01 +08:00
|
|
|
----
|
|
|
|
////
|
2020-05-28 19:11:15 +08:00
|
|
|
|
|
|
|
[source,console]
|
2020-06-18 22:46:01 +08:00
|
|
|
----
|
|
|
|
PUT /_data_stream/my-data-stream
|
|
|
|
----
|
2020-05-28 19:11:15 +08:00
|
|
|
// TEST[continued]
|
2020-05-13 20:51:39 +08:00
|
|
|
|
|
|
|
////
|
|
|
|
[source,console]
|
|
|
|
-----------------------------------
|
|
|
|
DELETE /_data_stream/my-data-stream
|
2020-05-28 19:11:15 +08:00
|
|
|
DELETE /_index_template/template
|
2020-05-13 20:51:39 +08:00
|
|
|
-----------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
////
|
|
|
|
|
|
|
|
[[indices-create-data-stream-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
2020-06-18 22:46:01 +08:00
|
|
|
`PUT /_data_stream/<data-stream>`
|
2020-05-13 20:51:39 +08:00
|
|
|
|
|
|
|
[[indices-create-data-stream-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
|
|
`<data-stream>`::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
(Required, string) Name of the data stream to create.
|
|
|
|
|
2021-01-13 22:09:15 +08:00
|
|
|
// tag::data-stream-name[]
|
2020-05-13 20:51:39 +08:00
|
|
|
Data stream names must meet the following criteria:
|
|
|
|
|
|
|
|
- Lowercase only
|
2021-01-13 22:09:15 +08:00
|
|
|
- Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, `#`, `:`, or a
|
|
|
|
space character
|
|
|
|
- Cannot start with `-`, `_`, `+`, or `.ds-`
|
2020-05-13 20:51:39 +08:00
|
|
|
- Cannot be `.` or `..`
|
2021-01-13 22:09:15 +08:00
|
|
|
- Cannot be longer than 255 bytes. Multi-byte characters
|
|
|
|
count towards this limit faster.
|
|
|
|
// end::data-stream-name[]
|
2020-05-13 20:51:39 +08:00
|
|
|
--
|
|
|
|
|