Skip to content

Commit 183c0a5

Browse files
authored
[Logs+] Adding ECS dynamic templates (#96171)
1 parent 2345873 commit 183c0a5

File tree

11 files changed

+665
-9
lines changed

11 files changed

+665
-9
lines changed

docs/changelog/96171.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 96171
2+
summary: "Adding ECS dynamic mappings component and applying it to logs data streams by default"
3+
area: Data streams
4+
type: enhancement
5+
issues:
6+
- 95538

modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/210_logs_custom_mappings.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
properties:
1414
numeric_field:
1515
type: integer
16+
socket:
17+
properties:
18+
ip:
19+
type: keyword
1620

1721
- do:
1822
indices.create_data_stream:
@@ -35,3 +39,33 @@
3539
index: $idx0name
3640
# verify that the new field from the custom component template is applied
3741
- match: { .$idx0name.mappings.properties.numeric_field.type: "integer" }
42+
43+
- do:
44+
index:
45+
index: logs-generic-default
46+
refresh: true
47+
body:
48+
test: 'doc-with-ip'
49+
socket:
50+
ip: 127.0.0.1
51+
- match: {result: "created"}
52+
53+
- do:
54+
search:
55+
index: logs-generic-default
56+
body:
57+
query:
58+
term:
59+
test:
60+
value: 'doc-with-ip'
61+
fields:
62+
- field: 'socket.ip'
63+
- length: { hits.hits: 1 }
64+
- match: { hits.hits.0._source.socket.ip: '127.0.0.1' }
65+
66+
- do:
67+
indices.get_mapping:
68+
index: $idx0name
69+
# test overriding of ECS dynamic template
70+
- match: { .$idx0name.mappings.properties.socket.properties.ip.type: "keyword" }
71+

0 commit comments

Comments
 (0)