diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts index 2c8a8f1578dfc..beaf0d286ed65 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts @@ -300,10 +300,10 @@ function _generateMappings( matchingType = field.object_type_mapping_type ?? field.object_type; break; case 'group': - const fields = field.fields.map((field) => ({ - ...field, + const fields = field.fields.map((dynField) => ({ + ...dynField, type: 'object', - object_type: field.object_type ?? field.type, + object_type: dynField.object_type ?? dynField.type, })) _generateMappings(fields, { ...ctx,