Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/reference/data-streams/set-up-a-data-stream.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ settings of a stream's backing indices may require reindexing. See
The following <<indices-templates,put index template API>> request
configures the `logs_data_stream` template.

Because no field mapping is specified, the `@timestamp` field uses the `date`
field data type by default.

[source,console]
----
PUT /_index_template/logs_data_stream
Expand All @@ -183,6 +186,31 @@ PUT /_index_template/logs_data_stream
}
----
// TEST[continued]

The following template maps `@timestamp` as a `date_nanos` field.

[source,console]
----
PUT /_index_template/logs_data_stream
{
"index_patterns": [ "logs*" ],
"data_stream": { },
"template": {
"mappings": {
"properties": {
"@timestamp": { "type": "date_nanos" } <1>
}
},
"settings": {
"index.lifecycle.name": "logs_policy"
}
}
}
----
// TEST[continued]

<1> Maps `@timestamp` as a `date_nanos` field. You can include other supported
mapping parameters in this field mapping.
====

NOTE: You cannot delete an index template that's in use by a data stream.
Expand Down