Skip to content

Commit

Permalink
[RFC] enforce single-valued fields (elastic#1674)
Browse files Browse the repository at this point in the history
Strawman RFC to discuss use of proposed elasticsearch mapping flag in enforcing single-valued fields
Add @djptek as Sponsor
Co-authored-by: Dominic Page <[email protected]>
  • Loading branch information
markharwood authored Nov 24, 2021
1 parent 4df5239 commit 442f6dd
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions rfcs/text/0029-enforce-single-value-fields.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 0029: Enforce single values for fields
- Stage: **0 (strawperson)**
- Date: **2021/11/24**

Most fields only hold single values but this is only partially documented and not formally enforced by elasticsearch mappings.
Elasticsearch is proposing some [changes to field mappings to allow arrays to be rejected](https://github.com/elastic/elasticsearch/issues/80825).
If ECS uses the new `allow_multiple_values:false` setting on single valued fields this would:

* Document more clearly which fields are single-valued for data providers and consumers.
* Ensure these declarations are enforced.

Note: this is is still proposed elasticsearch functionality so we are opening this RFC to see if there is interest in it.

## Fields

Potentially many fields. Probably best to start with clear candidates like `@timestamp` fields

## Usage

The `allow_multiple_values:false` flag will be added to elasticsearch field mappings that are single-valued (the default being multi-valued).

## Source data


## Scope of impact

Data providers that break the documented conventions for single-valued fields will have their documents rejected if they contain arrays.

## Concerns

We may not implement this elasticsearch feature (input from the ECS team will help determine how useful this feature might be)

## People

* @markharwood | Author
* @djptek | Sponsor

## References

https://github.com/elastic/elasticsearch/issues/80825

### RFC Pull Requests

0 comments on commit 442f6dd

Please sign in to comment.