-
Notifications
You must be signed in to change notification settings - Fork 119
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
Temporarily import hard-coded list of common fields #1018
Comments
Don't think I forgot anything here, but feel free to double check @andrewkroh @jsoriano . Agent:
Host:
Geo:
Cloud:
Docker (NON ECS FIELDS):
Kubernetes (NON ECS FIELDS):
Process:
|
What produces those "Geo" fields? In general I think it would be good to call out specifically what produces each set of fields. For example, say they are produced by IIRC there are also some |
@P1llus thanks for collecting the list of fields, I think this will be useful for elastic/package-spec#441. For the matter of this workaround I was thinking on a reduced list of fields, whose lack of mappings is currently causing known issues. I wouldn't like to hard-code many fields here. If we cannot benefit of a small list of hard-coded fields, I would wait to have elastic/package-spec#441 and #1017. Would you have a list of fields currently causing issues? |
@jsoriano the issue is mostly regarding any ECS field that processors add, because it will conflict with fields installed by other integrations. WDYT @jsoriano @andrewkroh ? |
Yes, but I wouldn't like to hard-code it in packages or in elastic-package, this is information that is not actually related to integrations. As mentioned, I would accept to hard-code a reduced set of fields if this is a low-hanging fruit to solve actual fixes that we have now.
Why input packages and not all packages? Documents of any input or integration can be enriched with processors. Hard-coding many fields has some problems:
|
We have been discussing about this, and we are going to include a set of hard-coded mappings that will include all ECS definitions. Longer term these mappings will be included by Fleet or Elasticsearch (see elastic/elasticsearch#85692), but for packages supporting current and old versions of the stack, we will continue using the method implemented here. We have to create a POC implementation in elastic-package, and decide if we need a change in the package-spec for this. We want this to be opt-in per package, and these dynamic mappings would be included in build time, so we probably need to add a setting under Dynamic template to include can be found in https://gist.github.com/P1llus/e0de7b3a7824a41a29660e253c6cce6b Thanks @P1llus! |
@P1llus we've been checking this issue in depth and it looks like that for input packages is not going to work. This issue is pending for input packages elastic/kibana#145529 Would that be a problem ? Is it ok to just make it working for integration packages ? |
@mrodm are you talking about dynamic templates or? The input packages we already have seems to not have any problems installing things like index mappings etc? |
@P1llus Yes, I was referring to using dynamic templates. Our first approach was to follow this (#1018 (comment)) to be able to cover more Elastic stack versions:
However, currently input packages do not support that. So, it would be available for integration packages first, and input packages would depend on elastic/kibana#145529. |
@P1llus I think Mario is referring to packages with type |
@mrodm @jsoriano At least we will be able to configure this for current integrations and have it work for older versions, when it comes to Would it be okay if we add dynamic templates to the current "custom input" packages, that is not of type input? Of course we won't be actually adding any dynamic templates yet, we still need to test more after the feature has been added in. |
Yes, this would work. |
Related to this bullet:
When the dynamic templates are added as part of the field definitions, there are some issues. For instance, there is a dynamic template for {
"location_to_geo_point": {
"match": "location",
"mapping": {
"type": "geo_point"
}
}
}, This template should match any full path containing location on it, but when trying to add a field definition in elastic-package this is not possible. In elastic-package , field definitions (name field), requires to have the full path for the field or using To start testing this feature, this package "elastic-package/test/packages/other/fields_tests" has been updated to include/import dynamic templates and it has been removed the geo-fields in the data_stream named
For those fields, this would be the field definition created in elastic-package during tests from the dynamic templates: - name: location
description: ""
type: geo_point
object_type: ""
value: ""
allowed_values: []
expected_values: []
pattern: ""
unit: ""
metric_type: ""
external: ecs
index: null
doc_values: null According to how elastic-package checks for fields, field definitions should be using full paths or be using wildcards for each word between dots something like:
With these current dynamic template definitions, I think fields should be kept in the packages too, @jsoriano WDYT ? |
As discussed over zoom, let's try to import the whole ECS for fields validation as we import external fields. |
This issue is a temporary workaround for elastic/package-spec#441 and #1017, discard it if the other issues are prioritized first.
For packages importing fields from ECS, import a hard-coded list of fields that are commonly used and can be a source of conflicts if they don't have any mapping.
Update: instead of adding specific fields, include dynamic mappings as described in #1018 (comment). We have to try how to add the dynamic mappings:
fields.yml
, this would only be supported by versions of kibana implementing [Fleet] Support dynamic_template mappings from object field kibana#137772 (>= 8.4.0).elasticsearch.index_template
key in packages and a new flag to opt in Add elasticsearch mappings definitions into input packages and a key to opt-in to import common definitions package-spec#455Fields imported this way should be imported in a new well-known fields file that can be discarded later by Fleet if elastic/kibana#144048 is implemented. For example they could be included in a file called
fields/imported_elastic_package.yml
.Fixes elastic/integrations#4236.
The text was updated successfully, but these errors were encountered: