This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Create data stream API
editCreate data stream APIedit
Creates a new data stream.
response = client.indices.create_data_stream( name: 'my-data-stream' ) puts response
PUT /_data_stream/my-data-stream
Requestedit
PUT /_data_stream/<data-stream>
Prerequisitesedit
-
If the Elasticsearch security features are enabled, you must have the
create_index
ormanage
index privilege for the data stream. - A matching index template with data stream enabled. See Set up a data stream.
Path parametersedit
-
<data-stream>
-
(Required, string) Name of the data stream to create. Data stream names must meet the following criteria:
- Lowercase only
-
Cannot include
\
,/
,*
,?
,"
,<
,>
,|
,,
,#
,:
, or a space character -
Cannot start with
-
,_
,+
, or.ds-
-
Cannot be
.
or..
- Cannot be longer than 255 bytes. Multi-byte characters count towards this limit faster.