File tree Expand file tree Collapse file tree 3 files changed +10
-14
lines changed
x-pack/plugin/otel-data/src
main/resources/component-templates
yamlRestTest/resources/rest-api-spec/test Expand file tree Collapse file tree 3 files changed +10
-14
lines changed Original file line number Diff line number Diff line change 1+ pr : 120547
2+ summary : Consistent mapping for OTel log and event bodies
3+ area : Data streams
4+ type : enhancement
5+ issues : []
Original file line number Diff line number Diff line change @@ -47,20 +47,11 @@ template:
4747 properties :
4848 text :
4949 type : match_only_text
50- flattened :
51- # this is used for complex bodies of regular log records
50+ structured :
51+ # this is used for complex bodies of log records (including events)
5252 # using the flattened field type avoids mapping issues which can be caused by logs containing arbitrary JSON objects
5353 # the tradeoff is that the flattened field type is currently not supported well by Kibana and has other limitations
5454 type : flattened
55- structured :
56- # this is used for events
57- # events are also represented as log records
58- # the event.name attribute uniquely identifies event structure / type of the payload (body)
59- # see also https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/events.md
60- # this makes them less prone to mapping issues, which is why we're enabling dynamic mappings
61- type : passthrough
62- dynamic : true
63- priority : 10
6455 message :
6556 type : alias
6657 path : body.text
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ Event body:
119119 indices.get_mapping :
120120 index : $datastream-backing-index
121121 - is_true : $datastream-backing-index
122- - match : { .$datastream-backing-index.mappings.properties.body.properties.structured.properties.foo\.bar. type: "keyword " }
122+ - match : { .$datastream-backing-index.mappings.properties.body.properties.structured.type: "flattened " }
123123 - match : { .$datastream-backing-index.mappings.properties.event_name.type: "keyword" }
124124---
125125Structured log body :
@@ -134,7 +134,7 @@ Structured log body:
134134 attributes :
135135 service.name : my-service
136136 body :
137- flattened :
137+ structured :
138138 foo :
139139 bar : baz
140140 - is_false : errors
@@ -146,7 +146,7 @@ Structured log body:
146146 indices.get_mapping :
147147 index : $datastream-backing-index
148148 - is_true : $datastream-backing-index
149- - match : { .$datastream-backing-index.mappings.properties.body.properties.flattened .type: "flattened" }
149+ - match : { .$datastream-backing-index.mappings.properties.body.properties.structured .type: "flattened" }
150150---
151151" event.dataset alias must point to data_stream.dataset " :
152152 - do :
You can’t perform that action at this time.
0 commit comments