From e5baacbe2e952588606e2b7dfbc02c65e53f28dd Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Tue, 14 Jul 2020 17:28:43 -0400 Subject: [PATCH] [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. --- .../change-mappings-and-settings.asciidoc | 52 +++---------------- .../set-up-a-data-stream.asciidoc | 2 +- .../data-streams/use-a-data-stream.asciidoc | 11 +--- docs/reference/ilm/ilm-tutorial.asciidoc | 11 +--- .../indices/create-data-stream.asciidoc | 11 +--- .../indices/delete-data-stream.asciidoc | 11 +--- .../indices/get-data-stream.asciidoc | 7 --- docs/reference/indices/resolve.asciidoc | 11 +--- .../reference/indices/rollover-index.asciidoc | 11 +--- .../authorization/alias-privileges.asciidoc | 11 +--- 10 files changed, 15 insertions(+), 123 deletions(-) diff --git a/docs/reference/data-streams/change-mappings-and-settings.asciidoc b/docs/reference/data-streams/change-mappings-and-settings.asciidoc index cfbe538dcfa..105cb726c33 100644 --- a/docs/reference/data-streams/change-mappings-and-settings.asciidoc +++ b/docs/reference/data-streams/change-mappings-and-settings.asciidoc @@ -52,31 +52,13 @@ PUT /_ilm/policy/logs_policy PUT /_index_template/logs_data_stream { "index_patterns": [ "logs*" ], - "data_stream": {}, - "template": { - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - } - } + "data_stream": { } } PUT /_index_template/new_logs_data_stream { "index_patterns": [ "new_logs*" ], - "data_stream": {}, - "template": { - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - } - } + "data_stream": { } } PUT /_data_stream/logs @@ -120,13 +102,10 @@ for a new field, `message`, to the template. PUT /_index_template/logs_data_stream { "index_patterns": [ "logs*" ], - "data_stream": {}, + "data_stream": { }, "template": { "mappings": { "properties": { - "@timestamp": { - "type": "date" - }, "message": { <1> "type": "text" } @@ -187,13 +166,10 @@ mapping parameter to `true`. PUT /_index_template/logs_data_stream { "index_patterns": [ "logs*" ], - "data_stream": {}, + "data_stream": { }, "template": { "mappings": { "properties": { - "@timestamp": { - "type": "date" - }, "host": { "properties": { "ip": { @@ -271,15 +247,8 @@ template's `index.refresh_interval` index setting to `30s` (30 seconds). PUT /_index_template/logs_data_stream { "index_patterns": [ "logs*" ], - "data_stream": {}, + "data_stream": { }, "template": { - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - }, "settings": { "index.refresh_interval": "30s" <1> } @@ -335,15 +304,8 @@ The following <> requests adds new PUT /_index_template/logs_data_stream { "index_patterns": [ "logs*" ], - "data_stream": {}, + "data_stream": { }, "template": { - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - }, "settings": { "sort.field": [ "@timestamp"], <1> "sort.order": [ "desc"] <2> @@ -448,7 +410,7 @@ uses the `logs_data_stream` template as its basis, with the following changes: PUT /_index_template/new_logs_data_stream { "index_patterns": [ "new_logs*" ], - "data_stream": {}, + "data_stream": { }, "template": { "mappings": { "properties": { 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 66d51083640..3c3bb28a997 100644 --- a/docs/reference/data-streams/set-up-a-data-stream.asciidoc +++ b/docs/reference/data-streams/set-up-a-data-stream.asciidoc @@ -177,7 +177,7 @@ field data type by default. PUT /_index_template/logs_data_stream { "index_patterns": [ "logs*" ], - "data_stream": {}, + "data_stream": { }, "template": { "settings": { "index.lifecycle.name": "logs_policy" diff --git a/docs/reference/data-streams/use-a-data-stream.asciidoc b/docs/reference/data-streams/use-a-data-stream.asciidoc index bc2f46931ab..6e3c72a3715 100644 --- a/docs/reference/data-streams/use-a-data-stream.asciidoc +++ b/docs/reference/data-streams/use-a-data-stream.asciidoc @@ -19,16 +19,7 @@ the following: PUT /_index_template/logs_data_stream { "index_patterns": [ "logs*" ], - "data_stream": {}, - "template": { - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - } - } + "data_stream": { } } PUT /_data_stream/logs diff --git a/docs/reference/ilm/ilm-tutorial.asciidoc b/docs/reference/ilm/ilm-tutorial.asciidoc index 55de4870fd0..5e6a1bbdf3e 100644 --- a/docs/reference/ilm/ilm-tutorial.asciidoc +++ b/docs/reference/ilm/ilm-tutorial.asciidoc @@ -121,19 +121,12 @@ with the options you specify. PUT _index_template/timeseries_template { "index_patterns": ["timeseries"], <1> - "data_stream": {}, + "data_stream": { }, "template": { "settings": { "number_of_shards": 1, "number_of_replicas": 1, "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. <2> The name of the {ilm-init} policy used to manage the data stream. -<3> A <> or <> field mapping for the -"@timestamp" field the data stream will use. ==== [discrete] diff --git a/docs/reference/indices/create-data-stream.asciidoc b/docs/reference/indices/create-data-stream.asciidoc index c8f0daa71a3..d7da6c95d7d 100644 --- a/docs/reference/indices/create-data-stream.asciidoc +++ b/docs/reference/indices/create-data-stream.asciidoc @@ -16,16 +16,7 @@ See <>. PUT /_index_template/template { "index_patterns": ["my-data-stream*"], - "template": { - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - } - }, - "data_stream": {} + "data_stream": { } } ---- //// diff --git a/docs/reference/indices/delete-data-stream.asciidoc b/docs/reference/indices/delete-data-stream.asciidoc index 9992356bd2c..1e019804ed2 100644 --- a/docs/reference/indices/delete-data-stream.asciidoc +++ b/docs/reference/indices/delete-data-stream.asciidoc @@ -14,16 +14,7 @@ indices. See <>. PUT /_index_template/template { "index_patterns": ["my-data-stream*"], - "template": { - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - } - }, - "data_stream": {} + "data_stream": { } } PUT /_data_stream/my-data-stream diff --git a/docs/reference/indices/get-data-stream.asciidoc b/docs/reference/indices/get-data-stream.asciidoc index b477ca6a817..e38c78b3ccc 100644 --- a/docs/reference/indices/get-data-stream.asciidoc +++ b/docs/reference/indices/get-data-stream.asciidoc @@ -37,13 +37,6 @@ PUT /_index_template/my-index-template "index_patterns": [ "my-data-stream*" ], "data_stream": {}, "template": { - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - }, "settings": { "index.lifecycle.name": "my-lifecycle-policy" } diff --git a/docs/reference/indices/resolve.asciidoc b/docs/reference/indices/resolve.asciidoc index 020aba8da99..c4fef080739 100644 --- a/docs/reference/indices/resolve.asciidoc +++ b/docs/reference/indices/resolve.asciidoc @@ -30,16 +30,7 @@ PUT /my-index/_alias/f-alias PUT /_index_template/foo_data_stream { "index_patterns": [ "foo" ], - "data_stream": {}, - "template": { - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - } - } + "data_stream": { } } PUT /_data_stream/foo diff --git a/docs/reference/indices/rollover-index.asciidoc b/docs/reference/indices/rollover-index.asciidoc index 1b8d124dab5..6fa45d26e31 100644 --- a/docs/reference/indices/rollover-index.asciidoc +++ b/docs/reference/indices/rollover-index.asciidoc @@ -232,16 +232,7 @@ The API returns the following response: PUT _index_template/template { "index_patterns": ["my-data-stream*"], - "template": { - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - } - }, - "data_stream": {} + "data_stream": { } } ----------------------------------- // TEST diff --git a/x-pack/docs/en/security/authorization/alias-privileges.asciidoc b/x-pack/docs/en/security/authorization/alias-privileges.asciidoc index 96969d1012b..be91f9282ae 100644 --- a/x-pack/docs/en/security/authorization/alias-privileges.asciidoc +++ b/x-pack/docs/en/security/authorization/alias-privileges.asciidoc @@ -43,16 +43,7 @@ backing indices, the user can retrieve a document directly from `.ds-logs-000002 PUT /_index_template/logs_data_stream { "index_patterns": [ "logs*" ], - "data_stream": {}, - "template": { - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - } - } + "data_stream": { } } PUT /_data_stream/logs