Add support for constant_keyword "value" in field definition#386
Conversation
For the constant_keyword field type Elasticsearch allows for the value to be specified in the mapping. If the value is not specified in the mapping then the value is set based on the first document that is indexed. This adds support for specifying a constant_keyword "value" in a field definition. https://www.elastic.co/guide/en/elasticsearch//reference/7.12/keyword.html#constant-keyword-params Package data streams will be able to explicitly declare a constant_keyword value and will not have to include the field with every document sent. This gives packages more control over constant_keyword field values. It can be used optimize storage for an integration since you could omit the constant_keyword field entirely an event's _source. Relates: elastic/package-spec#194
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪 |
mtojek
left a comment
There was a problem hiding this comment.
There are more changes required than this as we enabled fields dependency management.
It's related to the use case I mentioned in https://github.com/elastic/package-spec/pull/194/files#r656795658 (import field definition and override some properties). If we want to enable properties overriding. We have to modify the logic calling fdm.ImportFields (see:
|
Good point, I'll look over the places you mention and start adding support for overriding. I can see a use-case for a field like |
|
@andrewkroh Do you plan to finalize this PR or split into multiple chunks? If it's ready for review, please unmark the draft mode. |
…:andrewkroh/elastic-package into feature/constant-keyword-value-field-def
|
I will implement the ability to set attributes for external fields in a separate PR. The issue to track this feature is #392. |
mtojek
left a comment
There was a problem hiding this comment.
Ship it! Please also update the dependency in the elastic/integrations.
For the constant_keyword field type Elasticsearch allows for the value to be specified in the mapping.
If the value is not specified in the mapping then the value is set based on the first document that is
indexed. This adds support for specifying a constant_keyword "value" in a field definition.
Package data streams will be able to explicitly declare a
constant_keywordvalue and will not have toinclude the field with every document sent. It can be used optimize storage for an integration since
you could omit the constant_keyword field entirely an event's
_source.Depends on: elastic/package-spec#194 (this requires a spec update)
package-spec update: elastic/package-spec@b358e97