Get the lifecycle of a data streamedit

This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.

Gets the lifecycle of a set of data streams.

Requestedit

GET _data_stream/<data-stream>/_lifecycle

Descriptionedit

Gets the lifecycle of the specified data streams. If multiple data streams are requested but at least one of them does not exist, then the API will respond with 404 since at least one of the requested resources could not be retrieved. If the requested data streams do not have a lifecycle configured they will still be included in the API response but the lifecycle key will be missing.

Path parametersedit

<data-stream>
(Required, string) Comma-separated list of data streams used to limit the request. Supports wildcards (*). To target all data streams use * or _all.

Query parametersedit

expand_wildcards

(Optional, string) Type of data stream that wildcard patterns can match. Supports comma-separated values, such as open,hidden. Valid values are:

all, hidden
Match any data stream, including hidden ones.
open, closed
Matches any non-hidden data stream. Data streams cannot be closed.
none
Wildcard patterns are not accepted.

Defaults to open.

include_defaults
(Optional, Boolean) If true, return all default settings in the response. Defaults to false.

Response bodyedit

data_streams

(array of objects) Contains information about retrieved data stream lifecycles.

Properties of objects in data_streams
name
(string) Name of the data stream.
lifecycle

(Optional, object)

Properties of lifecycle
data_retention
(Optional, string) If defined, every document added to this data stream will be stored at least for this time frame. Any time after this duration the document could be deleted. When undefined, every document in this data stream will be stored indefinitely.
rollover
(Optional, object) The conditions which will trigger the rollover of a backing index as configured by the cluster setting cluster.dlm.default.rollover. This property is an implementation detail and it will only be retrieved when the query param include_defaults is set to true. The contents of this field are subject to change.

Examplesedit

Let’s retrieve the lifecycles:

GET _data_stream/my-data-stream*/_lifecycle

The response will look like the following:

{
  "data_streams": [
    {
      "name": "my-data-stream-1",
      "lifecycle": {
        "data_retention": "7d"
      }
    },
    {
      "name": "my-data-stream-2",
      "lifecycle": {
        "data_retention": "7d"
      }
    }
  ]
}