mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 15:47:23 -04:00
PRs #73062 and #73043 repurposed the `alias` anchor for a new guide for index and data stream aliases. Previously, this anchor was used for our field alias documentation. Repurposing the anchor has caused continuity errors for users selecting different versions of the ES docs. It could also cause confusion for users with a `/current/` link to the `alias` page. This updates the anchor for the alias guide and adds a redirect page to disambiguate the `alias` anchor. It also fixes a bread crumb issue for redirects following the 'Modifying your Data' redirect page. Closes #77034.
99 lines
2.1 KiB
Text
99 lines
2.1 KiB
Text
[role="xpack"]
|
|
[[indices-migrate-to-data-stream]]
|
|
=== Migrate to data stream API
|
|
++++
|
|
<titleabbrev>Migrate to data stream</titleabbrev>
|
|
++++
|
|
|
|
Converts an <<aliases,index alias>> to a <<data-streams,data stream>>.
|
|
|
|
////
|
|
[source,console]
|
|
----
|
|
POST idx1/_doc/
|
|
{
|
|
"message" : "testing",
|
|
"@timestamp" : "2020-01-01"
|
|
}
|
|
|
|
POST idx2/_doc/
|
|
{
|
|
"message" : "testing2",
|
|
"@timestamp" : "2020-01-01"
|
|
}
|
|
|
|
POST /_aliases
|
|
{
|
|
"actions": [
|
|
{
|
|
"add": {
|
|
"index": "idx1",
|
|
"alias": "my-logs",
|
|
"is_write_index": true
|
|
}
|
|
},
|
|
{
|
|
"add": {
|
|
"index": "idx2",
|
|
"alias": "my-logs"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
|
|
PUT /_index_template/template
|
|
{
|
|
"index_patterns": ["my-logs*"],
|
|
"data_stream": { }
|
|
}
|
|
----
|
|
////
|
|
|
|
[source,console]
|
|
----
|
|
POST /_data_stream/_migrate/my-logs
|
|
----
|
|
// TEST[continued]
|
|
|
|
////
|
|
[source,console]
|
|
-----------------------------------
|
|
DELETE /_data_stream/my-logs
|
|
DELETE /_index_template/template
|
|
-----------------------------------
|
|
// TEST[continued]
|
|
////
|
|
|
|
[[indices-migrate-to-data-stream-request]]
|
|
==== {api-request-title}
|
|
|
|
`POST /_data_stream/_migrate/<alias>`
|
|
|
|
[[indices-migrate-to-data-stream-prereqs]]
|
|
==== {api-prereq-title}
|
|
|
|
* If the {es} {security-features} are enabled, you must have the `manage`
|
|
<<privileges-list-indices,index privilege>> for the index alias.
|
|
|
|
* A matching <<index-templates,index template>> with data stream enabled.
|
|
See <<set-up-a-data-stream>>.
|
|
|
|
[[indices-migrate-to-data-stream-api-path-params]]
|
|
==== {api-path-parms-title}
|
|
|
|
`<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,write index>>.
|
|
- All indices for the alias have a `@timestamp` field mapping of a `date` or `date_nanos` field type.
|
|
- The alias must not have any <<filter-alias,filters>>.
|
|
- The alias must not use <<alias-routing,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.
|
|
--
|