diff --git a/NOTICE.txt b/NOTICE.txt index d86c0c6a7b5..80372b65074 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -573,11 +573,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/apm-data@v0.1.1 -------------------------------------------------------------------------------- Dependency : github.com/elastic/beats/v7 -Version: v7.0.0-alpha2.0.20231129140234-9a93c21c218c +Version: v7.0.0-alpha2.0.20231204122024-b30a5ec82af0 Licence type (autodetected): Elastic -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/beats/v7@v7.0.0-alpha2.0.20231129140234-9a93c21c218c/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/github.com/elastic/beats/v7@v7.0.0-alpha2.0.20231204122024-b30a5ec82af0/LICENSE.txt: Source code in this repository is variously licensed under the Apache License Version 2.0, an Apache compatible license, or the Elastic License. Outside of diff --git a/docs/custom-index-template.asciidoc b/docs/custom-index-template.asciidoc index 42699aede2d..aa18b1f16dc 100644 --- a/docs/custom-index-template.asciidoc +++ b/docs/custom-index-template.asciidoc @@ -15,7 +15,7 @@ These index templates are composed of multiple component templates--reusable bui that configure index mappings, settings, and aliases. The default APM index templates can be viewed in {kib}. -Navigate to **{stack-manage-app}** > **Index Management** > **Index Templates**, and search for `apm`. +Navigate to **{stack-manage-app}** → **Index Management** → **Index Templates**, and search for `apm`. Select any of the APM index templates to view their relevant component templates. [discrete] @@ -30,21 +30,27 @@ When you install the APM integration, {fleet} creates a default `@custom` compon You can edit this `@custom` component template to customize your {es} indices. First, determine which <> you'd like to edit. -Then, open {kib} and navigate to **{stack-manage-app}** > **Index Management** > **Component Templates**. +Then, open {kib} and navigate to **{stack-manage-app}** → **Index Management** → **Component Templates**. Custom component templates are named following this pattern: `@custom`. Search for the name of the data stream, like `traces-apm`, and select its custom component template. In this example, that'd be, `traces-apm@custom`. -Then click **Manage** > **Edit**. +Then click **Manage** → **Edit**. -Add any custom index settings, metadata, or mappings. -For example, you may want to... +Add any custom metadata, index settings, or mappings. + +[discrete] +[[custom-index-template-index-settings]] +==== Index settings + +In the **Index settings** step, you can specify custom {ref}/index-modules.html#index-modules-settings[index settings]. +For example, you could: * Customize the index lifecycle policy applied to a data stream. See <> for a walk-through. * Change the number of {ref}/scalability.html[shards] per index. -Specify the number of primary shards in the **index settings**: +Specify the number of primary shards: + [source,json] ---- @@ -56,7 +62,7 @@ Specify the number of primary shards in the **index settings**: ---- * Change the number of {ref}/docs-replication.html[replicas] per index. -Specify the number of replica shards in the **index settings**: +Specify the number of replica shards: + [source,json] ---- @@ -67,6 +73,29 @@ Specify the number of replica shards in the **index settings**: } ---- +[discrete] +[[custom-index-template-mappings]] +==== Mappings + +{ref}/mapping.html[Mapping] is the process of defining how a document, and the fields it contains, are stored and indexed. +In the *Mappings* step, you can add custom field mappings. +For example, you could: + +* Add custom field mappings that you can index on and search. +In the *Mapped fields* tab, add a new field including the {ref}/mapping-types.html[field type]: ++ +image::images/custom-index-template-mapped-fields.png[Editing a component template to add a new mapped field] + +* Add a {ref}/runtime.html[runtime field] that is evaluated at query time. +In the *Runtime fields* tab, click *Create runtime field* and provide a field name, +type, and optionally a script: ++ +image::images/custom-index-template-runtime-fields.png[Editing a component template to add a new runtime field] + +[discrete] +[[custom-index-template-rollover]] +=== Roll over the data stream + Changes to component templates are not applied retroactively to existing indices. For changes to take effect, you must create a new write index for the data stream. This can be done with the {es} {ref}/indices-rollover-index.html[Rollover API]. diff --git a/docs/images/custom-index-template-mapped-fields.png b/docs/images/custom-index-template-mapped-fields.png new file mode 100644 index 00000000000..cfd92d21744 Binary files /dev/null and b/docs/images/custom-index-template-mapped-fields.png differ diff --git a/docs/images/custom-index-template-runtime-fields.png b/docs/images/custom-index-template-runtime-fields.png new file mode 100644 index 00000000000..a792bcc164b Binary files /dev/null and b/docs/images/custom-index-template-runtime-fields.png differ diff --git a/go.mod b/go.mod index 4ffd2da1201..a6086aeaec4 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/dustin/go-humanize v1.0.1 github.com/elastic/apm-aggregation v0.0.0-20230815024520-e75a37d9ddd6 github.com/elastic/apm-data v0.1.1-0.20230928144734-40b63726f3b7 - github.com/elastic/beats/v7 v7.0.0-alpha2.0.20231129140234-9a93c21c218c + github.com/elastic/beats/v7 v7.0.0-alpha2.0.20231204122024-b30a5ec82af0 github.com/elastic/elastic-agent-client/v7 v7.4.0 github.com/elastic/elastic-agent-libs v0.6.2 github.com/elastic/elastic-agent-system-metrics v0.8.2 diff --git a/go.sum b/go.sum index a4cc59184eb..eedd9bb840e 100644 --- a/go.sum +++ b/go.sum @@ -136,8 +136,8 @@ github.com/elastic/apm-aggregation v0.0.0-20230815024520-e75a37d9ddd6 h1:Js+C3HE github.com/elastic/apm-aggregation v0.0.0-20230815024520-e75a37d9ddd6/go.mod h1:ba3gaJCuhxXN/O5AuiI56xxd6DukQdVOK0NfpzBntNo= github.com/elastic/apm-data v0.1.1-0.20230928144734-40b63726f3b7 h1:QcfCHAh1bHj9WN6y75bD6mBlIIlz9dJVKJSJVXCu4TM= github.com/elastic/apm-data v0.1.1-0.20230928144734-40b63726f3b7/go.mod h1:lMTMoCWNadiDJih/tLechuMTtumEeedtKJlBOYAv030= -github.com/elastic/beats/v7 v7.0.0-alpha2.0.20231129140234-9a93c21c218c h1:ngARH1pZ3zP5nf1SnNRfBhewDSemoWOaPj/Y0y2A9S0= -github.com/elastic/beats/v7 v7.0.0-alpha2.0.20231129140234-9a93c21c218c/go.mod h1:yIwy1g6P8eX/AmxB1qu86PC+HxH6VTAyE4Jnjb9TkoE= +github.com/elastic/beats/v7 v7.0.0-alpha2.0.20231204122024-b30a5ec82af0 h1:2+kLmovv8rWdK4A0zH8XBGlEUQy0fXOlSy/DfcGwq6c= +github.com/elastic/beats/v7 v7.0.0-alpha2.0.20231204122024-b30a5ec82af0/go.mod h1:tyPnUi2tTvUlfby7/yBWoDvibj5DKidutSS2GItT6qM= github.com/elastic/elastic-agent-autodiscover v0.6.4 h1:K+xC7OGgcy4fLXVuGgOGLs+eXCqRnRg2SQQinxP+KsA= github.com/elastic/elastic-agent-autodiscover v0.6.4/go.mod h1:5+7NIBAILc0GkgxYW3ckXncu5wRZfltZhTY4aZAYP4M= github.com/elastic/elastic-agent-client/v7 v7.4.0 h1:h75oTkkvIjgiKVm61NpvTZP4cy6QbQ3zrIpXKGigyjo=