Skip to content

[8.x] Fix generation of dynamic mapping for object with specific subfield (#204104)#204493

Merged
jsoriano merged 3 commits intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-204104
Jan 8, 2025
Merged

[8.x] Fix generation of dynamic mapping for object with specific subfield (#204104)#204493
jsoriano merged 3 commits intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-204104

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…lastic#204104)

Fix generation of dynamic mapping for objects that have more specific
subfields in separate definitions.

This can be reproduced for example with:
```
- name: labels
  type: object
  object_type: keyword
  object_type_mapping_type: '*'
- name: labels.count
  type: long
```

Fleet expands and deduplicates field definitions before generating the
mappings, so the definitions above are converted to something like the
following:
```
- name: labels
  type: group
  object_type: keyword
  object_type_mapping_type: '*'
  fields:
  - name: count
    type: long
```

Usually fields of type `group` don't have an `object_type`, so this was
being ignored, the dynamic mapping was not being generated.

This issue was not reproduced if the object field name includes a
wildcard, like in `labels.*`, because then the expansion and
deduplication resolves to something like this:
```
- name: labels
  type: group
  fields:
  - name: '*'
    type: object
    object_type: keyword
    object_type_mapping_type: '*'
  - name: count
    type: long
```

(cherry picked from commit e3877e0)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Dec 16, 2024
@kibanamachine kibanamachine enabled auto-merge (squash) December 16, 2024 21:04
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Dec 16, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kapral18
Copy link
Copy Markdown
Contributor

Please do not merge this pull request. We disabled auto-merge because we are trying to merge a this big PR as part of sustainable architecture migration which is impossible with ever increasing stream of backports. We will resume the automerge after our PR is merged. Reach out to #sustainable-kibana-architecture for more info.

@kapral18 kapral18 disabled auto-merge December 17, 2024 16:39
@kapral18
Copy link
Copy Markdown
Contributor

Auto-merge has been re-enabled. Thank you for your patience. :heart

@stephmilovic stephmilovic enabled auto-merge (squash) December 17, 2024 19:33
@jlind23
Copy link
Copy Markdown
Contributor

jlind23 commented Jan 6, 2025

@jsoriano @kpollich do we want this in 8.x or only in 9.x? I can see that 8.16 and 8.17 backports were closed without being merged.

@jsoriano
Copy link
Copy Markdown
Member

jsoriano commented Jan 7, 2025

@jsoriano @kpollich do we want this in 8.x or only in 9.x? I can see that 8.16 and 8.17 backports were closed without being merged.

It would be nice to have this in 8.x too, yes. I didn't merge this in 8.16 and 8.17 to don't change this behavior there. This issue is only known to affect one package.

@jsoriano jsoriano disabled auto-merge January 7, 2025 08:09
@jsoriano jsoriano enabled auto-merge (squash) January 7, 2025 08:16
@jsoriano jsoriano merged commit 2fee796 into elastic:8.x Jan 8, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #22 / Journey[infra_hosts_view] "before all" hook for "Navigate to Hosts view and load 500 hosts"

Metrics [docs]

✅ unchanged

History

cc @jsoriano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:Fleet Team label for Observability Data Collection Fleet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants