-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using same key in dynamic template leads to overwrites #2693
Comments
Hi @simioa, the entries in the dynamic mapping ensure that whenever a new key nested under I just briefly tested everything through and cannot find an issue. E.g. indexing something like:
results in following mapping (derived by
|
Hi @simitt I applied the original template and made some testing:
I then tried to Index the following Event:
result:
Index Mapping after tried Indexing:
Only the scaled_float context.tags dynamic template is present in the mapping. Replacing
with
leads to successful Indexing (Index apmdyntest-6.8.2-test3) with mapping:
|
I just tested with your example document on a fresh One thing I noticed is that your template shows |
Yes we have a default template(order: 0) for all indices but it does not contain a dynamic_template entry for "context.tags".
Is this intended behavior? |
Sorry for the late response, with this additional information I was able to reproduce the issue. I am investigating internally how this should be fixed. |
@simioa this seems to be an issue with how template keys with the same name are merged. I added a comment in the according ES issue elastic/elasticsearch#29200. |
Fyi, the ES team discussed the problems arising from template keys with the same name in |
depends on elastic/beats#18849 |
* Fix for avoiding duplicate dynamic template names elastic#2693 * Align k8s.io/client-go with beats version
* Update beats framework to 7dabaf093231 * Fix for avoiding duplicate dynamic template names #2693 * Align k8s.io/client-go with beats version
Hi,
I don't know if this is rather a general elasticsearch issue but I found this "bug" in the apm-server Index template.
The dynamic_templates section in the exported Index Template contains objects with the same key which leads to overwrites rather than appends in the final Index Mapping.
The apm-server Index template contains the following definitions when exported with the
apm-server export template
command. Used version here is 6.8.2Those three definitions share the same "context.tags" key
When deployed and a Index is created with this template, only the last "context.tags" definition is contained in the Index Mapping, which leads to indexing failures when the field value is not a float
Renaming the keys to unique values as a workaround seems to fix this.
In the 7.x Index Template context.tags is replaced by labels which seems to have the same issue (not tested)
The text was updated successfully, but these errors were encountered: