-
Notifications
You must be signed in to change notification settings - Fork 456
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
Dynamic ECS mapping progress #5055
Comments
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
I have tested this with a few different packages like Initially this will be added to the custom input packages as a first phase. |
Currently awaiting status updates from 4-5 different teams that are currently testing, will add any updates here once the feedback is collected. |
I have tested with two different integrations |
Testing for It is not important at this stage to test every package, but rather try to have as diverse set of tests as possible, currently seems to be working quite well! |
One note that I can see is that fields do not get the Before going live we should look into if this should be necessary, as fleet sets this by default, but somehow this is overriden. |
During one of the tests, it was noted that since the dynamic template focuses only on ECS fields that are not of type keyword, any other field should be mapped to keyword by default. However if the source of the data actually comes in as INT/Long, we can be used to the value being automatically converted to string. I have seen one example of this with The best solution for this is a few different steps:
|
I'd love to get these dynamic mappings into the default mappings for |
Thanks @felixbarny Let's pick up the initial discussion sometime soon, might want to include @ruflin as well, we would first need to map out any potential pitfalls it could create. |
Testing the dynamic template for APM was performed here: elastic/apm-server#10155 and the output of the initial tests have been very positive! |
Really great to see this moving forward and also having apm on board. @felixbarny ++ on bringing this eventually to |
In https://github.com/elastic/elastic-package/pull/1093/files#diff-46325f013498dcd5e9ec6be22768014c10d9685cd852382599d3ad7cc5cc4b4c, a lot of repetition happens which makes reading and maintenance harder. Being able to specify arrays for matching types would be very helpful. Similar thing is also discussed here: elastic/elasticsearch#66364 @javanna Would be nice to get this prioritised. This is not a blocker for this effort but I think would help the overall usability. |
Eventually we should make this feature the default when generating a new package / data_stream, meaning it should be added by the |
This issue was used to track the progress of the initial implementation. There has been more coverage over time, but the usefulness of this issue is done, so I will close this for now. Any new initiative moving forward further will require a new issue. |
So excited to see this closed 🎉 |
@P1llus How can we make sure this adopted by most integrations moving forward? Can we make this the default in the generator? @rameshelastic @lalit-satapathy @andresrc Lets make sure we adopt this in our integrations. |
@P1llus
Would usage of dynamic mapping resolve the above issues? How is it chosen that which ecs fields are added for which Integration? |
Also, if we include dynamic mapping, how will the TSDB mapping happen? Will TSDB and dynamic mapping work together? |
@ishleenk17 The dynamic templates was indeed created to resolve those type of issues, though be aware that type conflicts happens because 1 integration has the wrong field type. We are also at a impass here, because the functionality I describe above was meant as a stepping stone, recently the dynamic template was merged into Elasticsearch as well, but I do not believe we have functionality for integrations to use that yet, the main end goal is for the implementation defined here (which is just a hardcoded template in elastic-package), to be replaced with that bundled dynamic template instead. All ECS fields was defined at some point, but this implementation has not been updated, as we rather want to start using that bundled dynamic template instead. However we really want to start using the version bundled with ES, as its more up to date and uses new dynamic template features which makes it much cleaner: https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/core/template-resources/src/main/resources/ecs%40mappings.json For the TSDB question you would have to check with @ruflin :) |
I think the end goal would be to remove ecs.yml from all integrations and use dynamic mapping. If that is done I expect all Integrations to be free of type conflict issue. (which we are seeing quite a lot lately).
I see you have mentioned a hardcoded template in EP. So that means it will always be the same set of ecs fields for all Integrations? Or does it vary? We have observed that in some Integrations service.* fields are present, in others, they aren't . Any specific reason for this?
Should we look into using dynamic mapping for resolving conflict issues? Or shall we wait for the ES feature to be enabled for Integrations? If we have to wait up, then for now we have to resort to manually handling all these issues.
I suppose this will be an important aspect @ruflin. Be it whatever approach we take, the ES one or the current one. |
Absolutely, one way or the other, we should not need to define ECS fields manually in the end, and will help us making future integration work more scaleable, when the number of integrations becomes even larger.
The dynamic template covers all ECS fields, for all integrations, but they are not field mappings. It will only create an actual mapping of a field once it has been used at least once, which makes it great to keep the field count down.
In the end we should have all integrations use the new version of the template bundled with ES.
|
@ishleenk17 Do the integrations that had some conflicts use the most recent For TSDB + ECS dynamic templates, I don't see a conflict here, maybe @felixbarny does? The ECS templates have now landed in Elasticsearch (thanks @eyalkoren ). We now need a plan on how this template can also be used in integrations. Unfortunately it will mean, this template only will become available to integrations running on newer stack versions. @P1llus Would it make sense the template that you currently build to align with the ES one? This means all updated integrations already get the newest / most complete template? |
No, most of them are not in the recent format_version. They don't use the dynamic ecs template. They are using the ecs.yml |
|
If we plan to move to ES template for ECS in future, I am not sure if we should migrate to the current dynamic template. |
My assumption is the change to dynamic templates is only a config change so low effort. Is this assumption correct? The effort to move to ES is larger and will take longer.
What is the conflict here? I expect the dynamic template does not contain any dimensions. The dimension fields we specify field by field and these dimension fields win over the dynamic ones? |
No, I don't think there's a conflict. But the dynamic templates don't define any dimensions. That can be done with manual field mappings, though. |
This issue is to track the progress and discussion around using the newly merged dynamic ECS template from elastic package: elastic/elastic-package#1073
Status on specific tests can be found in the issue comments below, but as an overview:
This was initially created for common usecases in custom input packages, that do not have any out of the box ECS mapping, and to cover beat processors like
add_host_metadata
that produces ECS fields that might not already be mapped: elastic/elastic-package#1018However this later evolves into replacing the need for adding ECS fields manually in each integration package, allowing all integration packages to map ECS field types automatically from a single source, to make it all more consistent.
This feature is currently in a TESTING phase until further notice, and package developers could use the below process to test their own packages with the dynamic template:
_dev/build/build.yml
ecs.yml
file from each datastream in the package.base-fields.yml
still has mappings for@timestamp
anddata_stream
fieldsformat_version
in your rootmanifest.yml
to2.3.0
elastic-package
Related issues:
elastic/elasticsearch#85692
#4961
elastic/ecs#1869
elastic/elasticsearch#89743
elastic/elastic-package#1018
elastic/elastic-package#1073
The text was updated successfully, but these errors were encountered: