In elastic/elasticsearch#86166 Elasticsearch introduced the subobjects: false parameter. This allows ingest flat key/value pairs that had in the past conflicts like host and host.name.
package-spec and Fleet should support this option in templates.
At first, the feature should be used with care in packages as the objects must be flattened before ingestion (see also elastic/apm#347 for more details). At the moment ingestion tools like Beats often follow the opposite approach and expand all objects. There are potential future improvements that solve this problem: elastic/apm#347 (comment)
From #425, we need to ensure that at least one of the following mappings produce expected results, so this is supported.
- name: prometheus.labels.*
type: object
object_type: keyword
subobjects: false
Should produce:
- A dynamic mapping for
prometheus.labels.*, with type keyword.
- A static mapping for
prometheus.labels, with type: object and subobjects: false.
- name: prometheus.labels
type: object
subobjects: false
Should produce a mapping for prometheus.labels with type: object and subobjects: false, independently of the existence of other related dynamic mappings.
Maybe this already works, but we would need to check it.
### Tasks
- [ ] https://github.com/elastic/package-spec/pull/573
- [ ] https://github.com/elastic/kibana/pull/171826
- [ ] https://github.com/elastic/package-spec/pull/727
In elastic/elasticsearch#86166 Elasticsearch introduced the
subobjects: falseparameter. This allows ingest flat key/value pairs that had in the past conflicts likehostandhost.name.package-spec and Fleet should support this option in templates.
At first, the feature should be used with care in packages as the objects must be flattened before ingestion (see also elastic/apm#347 for more details). At the moment ingestion tools like Beats often follow the opposite approach and expand all objects. There are potential future improvements that solve this problem: elastic/apm#347 (comment)
From #425, we need to ensure that at least one of the following mappings produce expected results, so this is supported.
Should produce:
prometheus.labels.*, with type keyword.prometheus.labels, withtype: objectandsubobjects: false.Should produce a mapping for
prometheus.labelswithtype: objectandsubobjects: false, independently of the existence of other related dynamic mappings.Maybe this already works, but we would need to check it.