File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
docs/reference/data-streams Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,9 @@ settings of a stream's backing indices may require reindexing. See
169169The following <<indices-templates,put index template API>> request
170170configures the `logs_data_stream` template.
171171
172+ Because no field mapping is specified, the `@timestamp` field uses the `date`
173+ field data type by default.
174+
172175[source,console]
173176----
174177PUT /_index_template/logs_data_stream
@@ -183,6 +186,31 @@ PUT /_index_template/logs_data_stream
183186}
184187----
185188// TEST[continued]
189+
190+ The following template maps `@timestamp` as a `date_nanos` field.
191+
192+ [source,console]
193+ ----
194+ PUT /_index_template/logs_data_stream
195+ {
196+ "index_patterns": [ "logs*" ],
197+ "data_stream": { },
198+ "template": {
199+ "mappings": {
200+ "properties": {
201+ "@timestamp": { "type": "date_nanos" } <1>
202+ }
203+ },
204+ "settings": {
205+ "index.lifecycle.name": "logs_policy"
206+ }
207+ }
208+ }
209+ ----
210+ // TEST[continued]
211+
212+ <1> Maps `@timestamp` as a `date_nanos` field. You can include other supported
213+ mapping parameters in this field mapping.
186214====
187215
188216NOTE: You cannot delete an index template that's in use by a data stream.
You can’t perform that action at this time.
0 commit comments