Skip to content

Add pattern attribute to .mac fields - #1871

Merged
ebeahan merged 6 commits into
elastic:mainfrom
ebeahan:add-mac-addr-pattern-field
Apr 11, 2022
Merged

Add pattern attribute to .mac fields#1871
ebeahan merged 6 commits into
elastic:mainfrom
ebeahan:add-mac-addr-pattern-field

Conversation

@ebeahan

@ebeahan ebeahan commented Apr 11, 2022

Copy link
Copy Markdown
Member

Overview

This PR sets the pattern attribute for the .mac address fields. The regex value is based on the format suggested in IETF RFC 7042.

Other changes

  • The pattern checking added in Add optional pattern attribute #1834 didn't handle examples with array values. If array is set in the normalized attribute, the example value is now treated as an array.
  • An example value not matching the pattern regex will cause an exception if using --strict. This is now documented in USAGE.md.

Resolves #1846

@ebeahan
ebeahan requested a review from a team as a code owner April 11, 2022 18:33
@ebeahan ebeahan self-assigned this Apr 11, 2022
@ebeahan
ebeahan merged commit cbca435 into elastic:main Apr 11, 2022
@ebeahan
ebeahan deleted the add-mac-addr-pattern-field branch April 11, 2022 21:25
ebeahan added a commit to ebeahan/ecs that referenced this pull request Apr 11, 2022
* set pattern attr on mac addr fields

* need to handle when examples are an array of values

* artifacts

* mention pattern check for --strict

* commenting

* changelog

(cherry picked from commit cbca435)
@ebeahan

ebeahan commented Apr 11, 2022

Copy link
Copy Markdown
Member Author

💚 All backports created successfully

Status Branch Result
8.3

Questions ?

Please refer to the Backport tool documentation

ebeahan added a commit that referenced this pull request Apr 11, 2022
* set pattern attr on mac addr fields

* need to handle when examples are an array of values

* artifacts

* mention pattern check for --strict

* commenting

* changelog

(cherry picked from commit cbca435)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants