Add non-indexed fields to ecs templates#106714
Conversation
x-pack/plugin/core/template-resources/src/main/resources/ecs@mappings.json
Outdated
Show resolved
Hide resolved
|
@eyalkoren Would be great to get your look at this one if you find some time. I wonder why this did not pop up in the tests and how we can adjust the tests to cover this use case. |
| { | ||
| "ecs_x509_public_key_exponent_non_indexed_keyword": { | ||
| "mapping": { | ||
| "type": "keyword", |
There was a problem hiding this comment.
it seems this is a long according to ECS? https://www.elastic.co/guide/en/ecs/8.11/ecs-x509.html#field-x509-public-key-exponent I really wonder if we should cover this "edge" case.
There was a problem hiding this comment.
I think I agree. ECS doesn't mention whether it's indexed or not - so I guess indexing is fair game (and it's left to the user to overwrite this)?
They are defined as non-indexed in ECS: https://github.com/elastic/ecs/blob/ee4e0979dbaa91c915a1b31a26e1ea814bfe75aa/schemas/x509.yml#L203 |
|
@ruflin the tests currently ignore the |
|
Thanks for the context @jsoriano - it threw me off that |
|
/ci |
|
@elasticmachine run |
|
|
Pinging @elastic/es-data-management (Team:Data Management) |
|
Hi @flash1293, I've created a changelog YAML for you. |
|
As usual, I pinged the wrong @leehinman , now added @dakrone . |
I don't think we need to wait with the test. My intention was to do it in a separate PR anyway to see it failing and then verify it gets fixed after merging this PR's fix. And I am not just saying that because my availability is non problematic 😬
Since this template uses a version variable which is used by all other components managed by the stack registry, I believe we would need to update the registry version, unless it was already updated after the latest release. |
|
I ended up pushing the ECS test adjustment here and verified that it fails when removing the |
felixbarny
left a comment
There was a problem hiding this comment.
Please increment org.elasticsearch.xpack.stack.StackTemplateRegistry#REGISTRY_VERSION, otherwise LGTM
x-pack/plugin/core/template-resources/src/main/resources/ecs@mappings.json
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/template-resources/src/main/resources/ecs@mappings.json
Outdated
Show resolved
Hide resolved
…asticsearch into flash1293/fix-ecs-templates
Some fields in ECS are specified to not get indexed. The existing default component template
ecs@mappingsisn't capturing this, so the fields will fall back to regularkeywordmapping:https://www.elastic.co/guide/en/ecs/current/ecs-event.html#field-event-original
Aligned with elastic/elastic-package#1733 - I'm not sure about the x509 fields, could you elaborate on these @jsoriano ?
This PR fixes the problem by adding dynamic templates for these fields.