-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Adjust ECS dynamic templates to support subobjects: false
#96712
Conversation
…cs-mappings-for-logs
Hi @eyalkoren, I've created a changelog YAML for you. |
Worked around the issue described in #96712 (comment) by creating a dedicated template for the test, so this should be ready for review. |
Pinging @elastic/es-data-management (Team:Data Management) |
The error you encountered sounds like a bug in how |
Opened #96768 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I find it slightly surprising that when we would use subobject: false that slightly different templates are required. This is ok for our template as we know the details but what about users. Is there a plan to make templates identical no matter if subobject is used or not?
It was somewhat expected that we'd need to adjust, given the way that dynamic templates'
There is already only one set of dynamic ECS templates that support both- note that the new One of the things I discussed today with @P1llus is extending his test tool to create a flatten version of all ECS mappings in addition to the nested one it currently creates, thus enabling us test our mappings with |
I modified @P1llus's test to use the final form of the ECS dynamic templates as we eventually merged them and ran it with the adjusted ECS mappings of this PR to verify that we don't have regression in this regard. Results seem consistent with the adjusted version:
|
With my latest addition to the test, I was able to verify that when generating a document that contains the entire ECS fields in a flattened form, the mappings proposed in this PR work as expected with |
We cannot yet set
subobjects: false
by default at the root level for logs data streams, unless we either modify all shippers to flatten all documents or we automatically flatten objects in Elasticsearch.However, we can already adjust the ECS dynamic templates to support that, which is what this PR does.
In order to test it, I am using a flatten document.
As I wrote in the test- it is not useable at the moment because setting
subobjects: false
through custom mappings fails with this error:@jbaiera if you find out why and how to avoid that- please let me know and I'll adjust what's needed.
In the mean time, this test can be executed by adding
subobjects: false
tologs-mappings
.@P1llus could you run your exhaustive ECS test with these dynamic templates to see that they are still valid for non-flatted as well?