[Fleet] Transform mappings lost in shallow merge #175331
Labels
bug
Fixes for quality problems that affect the customer experience
Team:Fleet
Team label for Observability Data Collection Fleet team
Kibana version: v8.11.0+
Describe the bug:
A transform definition in an integration may have multiple files of field mappings, for example:
Each file is processed and mappings are accumulated to produce the full set. However, mappings from files processed earlier will be overwritten if a later file defines a mapping for a field with the same prefix (e.g.
threat.*
. This is due to the shallow merge done here.This differs from the behavior of mappings files for a data stream.
This merge logic may have the additional issue that it only processes data under the
properties
key, and not sibling keys such asdynamic_templates
. I haven't verified this and it may be that it is correctly handled elsewhere.Expected behavior:
A mapping for one field shouldn't overwrite the mapping for another field, even if they are defined in separate files and share a field prefix.
Any additional context:
The current merge logic was introduced in #168499.
This issue came up in elastic/integrations#8920, where I initially had one file for overriding/extending ECS fields and another file for plain references to external ECS field definitions. To work around this issue I combined them into one file.
The text was updated successfully, but these errors were encountered: