[DOCS] Simplify index template snippets for data streams (#59533) (#59553)

Removes the `@timestamp` field mapping from several data stream index
template snippets.

With #59317, the `@timestamp` field defaults to a `date` field data type
for data streams.
This commit is contained in:
James Rodewig 2020-07-14 17:28:43 -04:00 committed by GitHub
parent be4483034c
commit e5baacbe2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 15 additions and 123 deletions

View File

@ -52,31 +52,13 @@ PUT /_ilm/policy/logs_policy
PUT /_index_template/logs_data_stream PUT /_index_template/logs_data_stream
{ {
"index_patterns": [ "logs*" ], "index_patterns": [ "logs*" ],
"data_stream": {}, "data_stream": { }
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
}
} }
PUT /_index_template/new_logs_data_stream PUT /_index_template/new_logs_data_stream
{ {
"index_patterns": [ "new_logs*" ], "index_patterns": [ "new_logs*" ],
"data_stream": {}, "data_stream": { }
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
}
} }
PUT /_data_stream/logs PUT /_data_stream/logs
@ -124,9 +106,6 @@ PUT /_index_template/logs_data_stream
"template": { "template": {
"mappings": { "mappings": {
"properties": { "properties": {
"@timestamp": {
"type": "date"
},
"message": { <1> "message": { <1>
"type": "text" "type": "text"
} }
@ -191,9 +170,6 @@ PUT /_index_template/logs_data_stream
"template": { "template": {
"mappings": { "mappings": {
"properties": { "properties": {
"@timestamp": {
"type": "date"
},
"host": { "host": {
"properties": { "properties": {
"ip": { "ip": {
@ -273,13 +249,6 @@ PUT /_index_template/logs_data_stream
"index_patterns": [ "logs*" ], "index_patterns": [ "logs*" ],
"data_stream": { }, "data_stream": { },
"template": { "template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
},
"settings": { "settings": {
"index.refresh_interval": "30s" <1> "index.refresh_interval": "30s" <1>
} }
@ -337,13 +306,6 @@ PUT /_index_template/logs_data_stream
"index_patterns": [ "logs*" ], "index_patterns": [ "logs*" ],
"data_stream": { }, "data_stream": { },
"template": { "template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
},
"settings": { "settings": {
"sort.field": [ "@timestamp"], <1> "sort.field": [ "@timestamp"], <1>
"sort.order": [ "desc"] <2> "sort.order": [ "desc"] <2>

View File

@ -19,16 +19,7 @@ the following:
PUT /_index_template/logs_data_stream PUT /_index_template/logs_data_stream
{ {
"index_patterns": [ "logs*" ], "index_patterns": [ "logs*" ],
"data_stream": {}, "data_stream": { }
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
}
} }
PUT /_data_stream/logs PUT /_data_stream/logs

View File

@ -127,13 +127,6 @@ PUT _index_template/timeseries_template
"number_of_shards": 1, "number_of_shards": 1,
"number_of_replicas": 1, "number_of_replicas": 1,
"index.lifecycle.name": "timeseries_policy" <2> "index.lifecycle.name": "timeseries_policy" <2>
},
"mappings": {
"properties": {
"@timestamp": {
"type": "date" <3>
}
}
} }
} }
} }
@ -142,8 +135,6 @@ PUT _index_template/timeseries_template
<1> Apply the template when a document is indexed into the `timeseries` target. <1> Apply the template when a document is indexed into the `timeseries` target.
<2> The name of the {ilm-init} policy used to manage the data stream. <2> The name of the {ilm-init} policy used to manage the data stream.
<3> A <<date,`date`>> or <<date_nanos,`date_nanos`>> field mapping for the
"@timestamp" field the data stream will use.
==== ====
[discrete] [discrete]

View File

@ -16,15 +16,6 @@ See <<set-up-a-data-stream>>.
PUT /_index_template/template PUT /_index_template/template
{ {
"index_patterns": ["my-data-stream*"], "index_patterns": ["my-data-stream*"],
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
},
"data_stream": { } "data_stream": { }
} }
---- ----

View File

@ -14,15 +14,6 @@ indices. See <<delete-a-data-stream>>.
PUT /_index_template/template PUT /_index_template/template
{ {
"index_patterns": ["my-data-stream*"], "index_patterns": ["my-data-stream*"],
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
},
"data_stream": { } "data_stream": { }
} }

View File

@ -37,13 +37,6 @@ PUT /_index_template/my-index-template
"index_patterns": [ "my-data-stream*" ], "index_patterns": [ "my-data-stream*" ],
"data_stream": {}, "data_stream": {},
"template": { "template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
},
"settings": { "settings": {
"index.lifecycle.name": "my-lifecycle-policy" "index.lifecycle.name": "my-lifecycle-policy"
} }

View File

@ -30,16 +30,7 @@ PUT /my-index/_alias/f-alias
PUT /_index_template/foo_data_stream PUT /_index_template/foo_data_stream
{ {
"index_patterns": [ "foo" ], "index_patterns": [ "foo" ],
"data_stream": {}, "data_stream": { }
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
}
} }
PUT /_data_stream/foo PUT /_data_stream/foo

View File

@ -232,15 +232,6 @@ The API returns the following response:
PUT _index_template/template PUT _index_template/template
{ {
"index_patterns": ["my-data-stream*"], "index_patterns": ["my-data-stream*"],
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
},
"data_stream": { } "data_stream": { }
} }
----------------------------------- -----------------------------------

View File

@ -43,16 +43,7 @@ backing indices, the user can retrieve a document directly from `.ds-logs-000002
PUT /_index_template/logs_data_stream PUT /_index_template/logs_data_stream
{ {
"index_patterns": [ "logs*" ], "index_patterns": [ "logs*" ],
"data_stream": {}, "data_stream": { }
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
}
} }
PUT /_data_stream/logs PUT /_data_stream/logs