Skip to content

Commit

Permalink
Tweak note about 'IDs' being keyword to also mention 'codes' (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
webmat authored Nov 1, 2018
1 parent 3ab5d4f commit 2cfa506
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,17 @@ of a breaking change with these two widely used fields in Beats.
Any future field that will be indexed for full text search in ECS will however
follow the multi-field convention where `text` indexing is nested in the multi-field.

### IDs are keywords not integers
### IDs and most codes are keywords, not integers

Despite the fact that IDs are often integers in various systems, this is not
always the case. Since we want to make it possible to map as many data sources
to ECS as possible, we default to using the `keyword` type for IDs.
Despite the fact that IDs and codes (e.g. error codes) are often integers,
this is not always the case.
Since we want to make it possible to map as many systems and data sources
to ECS as possible, we default to using the `keyword` type for IDs and codes.

Some specific kinds of codes are always integers, like HTTP status codes.
If those have a specific corresponding specific field (as HTTP status does),
its type can safely be an integer type.
But generic field like `error.code` cannot have this guarantee, and are therefore `keyword`.

# <a name="about-ecs"></a>FAQ

Expand Down
14 changes: 10 additions & 4 deletions docs/implementing.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@ of a breaking change with these two widely used fields in Beats.
Any future field that will be indexed for full text search in ECS will however
follow the multi-field convention where `text` indexing is nested in the multi-field.

### IDs are keywords not integers
### IDs and most codes are keywords, not integers

Despite the fact that IDs are often integers in various systems, this is not
always the case. Since we want to make it possible to map as many data sources
to ECS as possible, we default to using the `keyword` type for IDs.
Despite the fact that IDs and codes (e.g. error codes) are often integers,
this is not always the case.
Since we want to make it possible to map as many systems and data sources
to ECS as possible, we default to using the `keyword` type for IDs and codes.

Some specific kinds of codes are always integers, like HTTP status codes.
If those have a specific corresponding specific field (as HTTP status does),
its type can safely be an integer type.
But generic field like `error.code` cannot have this guarantee, and are therefore `keyword`.

0 comments on commit 2cfa506

Please sign in to comment.