-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Fleet] dynamic_template mappings for wildcard field names are not installed #129344
Comments
Pinging @elastic/fleet (Feature:EPM) |
Pinging @elastic/fleet (Team:Fleet) |
We should consider backporting a fix for this to 7.17.x depending on impact |
Actually, looking to beats mappings, the field doesn't need to have a wildcard. A field with
Is installed as:
+1 to backport this to 7.17. |
Another case that can produce dynamic mappings, the use of the |
Ah no sorry, this feature was reverted (elastic/package-spec#212, #102289 (comment)). |
@jsoriano What might be helpful is to have the Beats source code to look at. Do you know where this lives? |
Changed the wording to be more clear that this is really a bug |
@elastic/integrations It would be helpful to understand the impact of this issue on the integrations listed above so that we can prioritize appropriately. |
|
Regarding impact, we have to take into account that these fields will be used as if they had no mapping, what uses to be a source of problems. I think we are not seeing more issues related to this because the most visible issue of this is mappings conflict, and looking to the default rules, this will be only problematic if:
Apart of the mapping conflicts, there may be more subtle consequences of not having proper mappings, at least:
|
I think we need to go through the process to update the (I've started updating the specification to match what the code actually does in Fleet EPM today by looking at the typescript code. andrewkroh/package-spec@91d6513) |
Thank you, @andrewkroh. Agreed, we need to update the spec to match. Happy to have Fleet UI team help review once you have a PR. |
Thanks @andrewkroh! Could you open a PR with this change so we can continue the discussion there? In any case we need to support dynamic templates, and this brings the need of wildcards in names and supporting the |
Here's that change as a PR to package-spec elastic/package-spec#314. The goal there will be to sync up the spec to the current implementation. Then we can do a separate PR propose how dynamic mappings should work. |
Hi, |
Probably yes, CockroachDB package provides fields definitions (see here), but most of them are dynamic mappings, that are not being properly installed. |
@joshdover @jlind23 do we have a timeline for this issue? |
Regarding this, I think they should work the same way as in Beats. There may be limitations, but there are also strong advantages:
|
@andresrc This is a Fleet issue that hasn't been bubbled up in priority yet. Is this blocking some packages going GA? (like Cockroach DB?) |
@jen-huang yes, the team is working on CockroachDB in this iteration, thanks |
Bumped up to P1 per discussion with @akshay-saraswat as it is blocking CockroachDB integration from going GA. |
Thanks for prioritizing this! Take into account that this is not only about CockroachDB. Grepping around integrations, many packages have at least one field with |
I've seen the same error in the Prometheus package and I've added a dynamic template to the data_stream manually to fix it. If I understood correctly, by fixing what's been discussed here, we wouldn't need to create the dynamic mapping at the package level, right? |
related to the question above: would it be safe to add a |
Adding the
I am currently looking at this and it's seems not it's not a 1 for 1 change from the beats code to Fleet as we generate mappings a little differently, but I should be able to have a POC/draft PR early this. This change seems a little risky to me as it will impact a lot of package and we probably need to decide if it's a bug fix for 8.4 or an improvement in 8.5 cc @jen-huang |
@nchaulet Thanks for investigating. Let's continue working on the fix for this and then assess the risk from there. My feeling is that we may want to delay it to 8.5... |
@jsoriano When you say we should create a dynamic template for field with a name with a wildcard it is a new feature? I am not able to the code path that does this in beats |
@nchaulet oh, you are right, I didn't notice. It only happens to be that almost all fields with a wildcard in their name also have I say almost because I have found this one in Metricbeat, that effectively doesn't generate a dynamic mapping:
In integrations repo I see that there are more fileds with wildcards but without
Such field definitions both in beats and fleet generate static mappings with I think we should do something about this, so developers have what they probably expect. I see these options:
From these options I would prefer the first one, so we would have a better syntax for many of these use cases, and it would support the integrations that are already using it. Btw, while looking at this I have found that Beats generates both, the dynamic mapping and an static mapping with the wildcard, this is probably unexpected, I will open another issue in Beats about that. |
Integration packages have support for configuring wildcard field names in data streams. These fields are supposed to have an associated
dynamic_template
added to their mappings, however today, Fleet does not generate mappings for these. AFAICT, we have never had support for this in Fleet EPM code.From @jsoriano:
Here's an example of how this works in Beats. A field defined like this:
Results in a dynamic template added to the mappings like this:
We should be able to follow the Beats implementation to make this match on Fleet: https://github.com/elastic/beats/blob/ea207346d651448b8917b0791b2b117b9f9b9212/libbeat/template/processor.go#L444
We have several integrations using this feature today, but it's likely broken for customers due to this problem. In my rudimentary search on the integrations repo, I found that this is affecting these integrations:
The text was updated successfully, but these errors were encountered: