Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/changelog/95481.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 95481
summary: "Add support for `logs@custom` component template for `logs-*-* data streams"
area: Data streams
type: enhancement
issues:
- 95469
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
"Basic logs@custom component template functionality test":
- do:
cluster.put_component_template:
name: logs@custom
body:
template:
settings:
index:
query:
default_field: [ "custom-message" ]
mappings:
properties:
numeric_field:
type: integer

- do:
indices.create_data_stream:
name: logs-generic-default
- is_true: acknowledged

- do:
indices.get_data_stream:
name: logs-generic-default
- set: { data_streams.0.indices.0.index_name: idx0name }

- do:
indices.get_settings:
index: $idx0name
# verify that the custom settings.index.query.default_field overrides the default query field - "message"
- match: { .$idx0name.settings.index.query.default_field: ["custom-message"] }

- do:
indices.get_mapping:
index: $idx0name
# verify that the new field from the custom component template is applied
- match: { .$idx0name.mappings.properties.numeric_field.type: "integer" }
4 changes: 3 additions & 1 deletion x-pack/plugin/core/src/main/resources/logs-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"composed_of": [
"logs-mappings",
"data-streams-mappings",
"logs-settings"
"logs-settings",
"logs@custom"
],
"ignore_missing_component_templates": ["logs@custom"],
"allow_auto_create": true,
"_meta": {
"description": "default logs template installed by x-pack",
Expand Down