diff --git a/docs/reference/data-streams/set-up-a-data-stream.asciidoc b/docs/reference/data-streams/set-up-a-data-stream.asciidoc index 8464af5b3c669..66d51083640ec 100644 --- a/docs/reference/data-streams/set-up-a-data-stream.asciidoc +++ b/docs/reference/data-streams/set-up-a-data-stream.asciidoc @@ -169,6 +169,9 @@ settings of a stream's backing indices may require reindexing. See The following <> 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 @@ -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.