Migrate to data stream API
Migrate to data stream API
New API reference
For the most up-to-date API details, refer to Data stream APIs.
Converts an index alias to a data stream.
resp = client.indices.migrate_to_data_stream(
name="my-logs",
)
print(resp)
const response = await client.indices.migrateToDataStream({
name: "my-logs",
});
console.log(response);
POST /_data_stream/_migrate/my-logs
Request
POST /_data_stream/_migrate/<alias>
Prerequisites
- If the Elasticsearch security features are enabled, you must have the
manage
index privilege for the index alias. - A matching index template with data stream enabled. See Set up a data stream.
Path parameters
<alias>
(Required, string) Name of the index alias to convert to a data stream. The alias must meet the following criteria:
- The alias must have a write index.
- All indices for the alias have a
@timestamp
field mapping of adate
ordate_nanos
field type. - The alias must not have any filters.
- The alias must not use custom routing.
If successful, the request removes the alias and creates a data stream with the same name. The alias’s indices become hidden backing indices for the stream. The alias’s write index becomes the stream’s write index.
当前内容版权归 elasticsearch 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 elasticsearch .