-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[Logs+] Adding ECS dynamic templates #96171
Conversation
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.
From my perspective we cover too many fields in here by default. I would not map multi fields by default for example. To simplify the mappings, I think we can be even more generic on *.{field}
and _{field}
. Like this, ECS becomes more a pattern then specific fields. The nice part is, if we have *.ip
as keyword, it makes sure that also foo.ip
is a keyword by default.
There are some key fields we don't map like host.name
because these are keyword. I would still map these specifically, to ensure nobody is indexing host
at first. As soon as we have subobject: true
, this becomes less of a problem.
@ruflin Thanks for all the input! |
In general? For specific ones?
Wouldn't |
Summarizing my discussions with @felixbarny and @ruflin:
By relying on dynamic templates, we make sure we minimize the number of field mappings to only those that are actually encountered. One thing I've noticed during our discussions is that there may be a problem with using a generic fallback mapping for all field of a specific type, such as:
If such is included within a component template that is used in combination with another component template that includes dynamic mappings, it may override its configurations. This is something I'll test, but there are probably two options:
In both cases, we'll probably have to REPLACE |
Conclusions from tests: Some options we have going forward (assuming that we don't want to change
|
With regards to the following comment, I chose to go with the second option:
This accommodates @ruflin's request to include a default fallback mapping of
NOTE that by using the string-to-keyword default mapping, we introduce the same limitation we now encountered with the data-stream component template- anyone that would want to use the ECS template, will have to be aware of this default and the related limitation (not adding dynamic templates AFTER it). I hope I addressed all requirements and queries so far. This PR is ready for review. |
Pinging @elastic/es-data-management (Team:Data Management) |
Hi @eyalkoren, I've created a changelog YAML for you. |
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.
The change LGTM. As soon as this in, we should watch for any unexpected regressions. Few specific things I reviewed / checked:
- Is the
data-streams-mappings
mapping still around? Yes, this ensures even though we don't use it, if someone referenced it, they keep having the same experience - No
constant_keyword
fields in the ECS mappings: There are non, it was taken out which is expected - Are all ECS fields mapped: The tool from Marius confirmed this.
I have a concern that we have not landed yet on a naming convention for templates and pipelines #96267 We are introducing 3 new component templates, good time to have one. The PR can go in and we can still change it as a follow up but it must happen before we release it.
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.
The change LGTM. As soon as this in, we should watch for any unexpected regressions. Few specific things I reviewed / checked:
- Is the
data-streams-mappings
mapping still around? Yes, this ensures even though we don't use it, if someone referenced it, they keep having the same experience - No
constant_keyword
fields in the ECS mappings: There are non, it was taken out which is expected - Are all ECS fields mapped: The tool from Marius confirmed this.
I have a concern that we have not landed yet on a naming convention for templates and pipelines #96267 We are introducing 3 new component templates, good time to have one. The PR can go in and we can still change it as a follow up but it must happen before we release it.
Summarizing the feedback received offline:
38cbb38 and 150b0ab contain the implementation of this feedback. Rationale:
@ruflin @felixbarny please provide feedback on the above. |
x-pack/plugin/core/src/main/resources/ecs-dynamic-mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/string-to-keyword-dynamic-mapping.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/ecs-data-stream-mappings.json
Outdated
Show resolved
Hide resolved
To conclude the naming discussion, I put a comment in #96267 (comment) My specific proposal for this PR is:
|
test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java
Outdated
Show resolved
Hide resolved
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.
I'm ok to get this merged as is and have a quick follow up PR with ecs@dynamic_templates
.
x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackTemplateRegistry.java
Show resolved
Hide resolved
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
Closes #95538