Skip to content

Commit

Permalink
[8.5] Fix type of normalize for process.io.bytes_skipped (#2094) (#2096)
Browse files Browse the repository at this point in the history
* [8.5] Fix type of normalize for process.io.bytes_skipped (#2094)

* Test that normalize fields are always lists

Fails with AssertionError: 'array' is not an instance of <class 'list'> : process.io.bytes_skipped

* Fix type of normalize for process.io.bytes_skipped

* update changelog

Co-authored-by: Kylie Geller <[email protected]>

* Update changelog

Co-authored-by: Dan Kortschak <[email protected]>
Co-authored-by: Kylie Geller <[email protected]>
  • Loading branch information
3 people authored Nov 2, 2022
1 parent 125ff11 commit 7eea292
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 7 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.next.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ Thanks, you're awesome :-) -->

#### Deprecated

## [8.5.1](https://github.com/elastic/ecs/compare/v8.5.0...v8.5.1)

### Schema Changes

#### Added

#### Improvements

### Tooling and Artifact Changes

#### Bugfixes

* Fix type of `normalize` in `process.io.bytes_skipped`. #2094

## 8.5.0 (Hard Feature Freeze)

### Schema Changes
Expand Down
2 changes: 1 addition & 1 deletion experimental/generated/csv/fields.csv
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ ECS_Version,Indexed,Field_Set,Field,Type,Level,Normalization,Example,Description
8.5.0+exp,true,process,process.hash.tlsh,keyword,extended,,,TLSH hash.
8.5.0+exp,true,process,process.interactive,boolean,extended,,True,Whether the process is connected to an interactive shell.
8.5.0+exp,true,process,process.io,object,extended,,,A chunk of input or output (IO) from a single process.
8.5.0+exp,true,process,process.io.bytes_skipped,object,extended,"a, r, r, a, y",,An array of byte offsets and lengths denoting where IO data has been skipped.
8.5.0+exp,true,process,process.io.bytes_skipped,object,extended,array,,An array of byte offsets and lengths denoting where IO data has been skipped.
8.5.0+exp,true,process,process.io.bytes_skipped.length,number,extended,,,The length of bytes skipped.
8.5.0+exp,true,process,process.io.bytes_skipped.offset,number,extended,,,The byte offset into this event's io.text (or io.bytes in the future) where length bytes were skipped.
8.5.0+exp,true,process,process.io.max_bytes_per_process_exceeded,boolean,extended,,,"If true, the process producing the output has exceeded the max_kilobytes_per_process configuration setting."
Expand Down
3 changes: 2 additions & 1 deletion experimental/generated/ecs/ecs_flat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8493,7 +8493,8 @@ process.io.bytes_skipped:
flat_name: process.io.bytes_skipped
level: extended
name: io.bytes_skipped
normalize: array
normalize:
- array
short: An array of byte offsets and lengths denoting where IO data has been skipped.
type: object
process.io.bytes_skipped.length:
Expand Down
3 changes: 2 additions & 1 deletion experimental/generated/ecs/ecs_nested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10201,7 +10201,8 @@ process:
flat_name: process.io.bytes_skipped
level: extended
name: io.bytes_skipped
normalize: array
normalize:
- array
short: An array of byte offsets and lengths denoting where IO data has been
skipped.
type: object
Expand Down
2 changes: 1 addition & 1 deletion generated/csv/fields.csv
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ ECS_Version,Indexed,Field_Set,Field,Type,Level,Normalization,Example,Description
8.5.0,true,process,process.hash.tlsh,keyword,extended,,,TLSH hash.
8.5.0,true,process,process.interactive,boolean,extended,,True,Whether the process is connected to an interactive shell.
8.5.0,true,process,process.io,object,extended,,,A chunk of input or output (IO) from a single process.
8.5.0,true,process,process.io.bytes_skipped,object,extended,"a, r, r, a, y",,An array of byte offsets and lengths denoting where IO data has been skipped.
8.5.0,true,process,process.io.bytes_skipped,object,extended,array,,An array of byte offsets and lengths denoting where IO data has been skipped.
8.5.0,true,process,process.io.bytes_skipped.length,number,extended,,,The length of bytes skipped.
8.5.0,true,process,process.io.bytes_skipped.offset,number,extended,,,The byte offset into this event's io.text (or io.bytes in the future) where length bytes were skipped.
8.5.0,true,process,process.io.max_bytes_per_process_exceeded,boolean,extended,,,"If true, the process producing the output has exceeded the max_kilobytes_per_process configuration setting."
Expand Down
3 changes: 2 additions & 1 deletion generated/ecs/ecs_flat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8424,7 +8424,8 @@ process.io.bytes_skipped:
flat_name: process.io.bytes_skipped
level: extended
name: io.bytes_skipped
normalize: array
normalize:
- array
short: An array of byte offsets and lengths denoting where IO data has been skipped.
type: object
process.io.bytes_skipped.length:
Expand Down
3 changes: 2 additions & 1 deletion generated/ecs/ecs_nested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10121,7 +10121,8 @@ process:
flat_name: process.io.bytes_skipped
level: extended
name: io.bytes_skipped
normalize: array
normalize:
- array
short: An array of byte offsets and lengths denoting where IO data has been
skipped.
type: object
Expand Down
3 changes: 2 additions & 1 deletion schemas/process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@
description: >
An array of byte offsets and lengths denoting where IO data has been skipped.
normalize: array
normalize:
- array

- name: io.bytes_skipped.offset
level: extended
Expand Down
4 changes: 4 additions & 0 deletions scripts/tests/test_ecs_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ def test_related_fields_always_arrays(self):
self.assertIn('array', field['normalize'],
"All fields under `related.*` should be arrays")

def test_normalize_always_array(self):
for (field_name, field) in self.ecs_fields.items():
self.assertIsInstance(field.get('normalize'), list, field_name)


if __name__ == '__main__':
unittest.main()

0 comments on commit 7eea292

Please sign in to comment.