Migrate to data stream API
Converts an index alias to a data stream.
POST /_data_stream/_migrate/my-logs
Request
POST /_data_stream/_migrate/<alias>
Prerequisites
- If the Elasticsearch security features are enabled, you must have the
manageindex 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
@timestampfield mapping of adateordate_nanosfield 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.
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/indices-migrate-to-data-stream.html