Skip to content

Commit

Permalink
Changed type of process.env_vars to show shadowing (#2038)
Browse files Browse the repository at this point in the history
* Changed type of process.env_vars to show shadowing

Updated the type of process.env_vars to be an array of string keywords
to support shadowed variables, i.e. duplicated names with different
values.

* updated CHANGELOG.next.md

Co-authored-by: Kylie Geller <[email protected]>
  • Loading branch information
Tacklebox and kgeller authored Aug 25, 2022
1 parent 9a3611b commit ad61000
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 54 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.next.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Thanks, you're awesome :-) -->

## 8.5.0 (Soft Feature Freeze)

* Changed `process.env_vars` field type to be an array of keywords. #2038

### Schema Changes

#### Breaking changes
Expand Down
11 changes: 7 additions & 4 deletions docs/fields/field-details.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7350,15 +7350,18 @@ type: keyword

a| beta:[ This field is beta and subject to change. ]

Environment variables (`env_vars`) set at the time of the event. May be filtered to protect sensitive information.
Array of environment variable bindings. Captured from a snapshot of the environment at the time of execution.

The field should not contain nested objects. All values should use `keyword`.
May be filtered to protect sensitive information.

type: object
type: keyword


Note: this field should contain an array of values.



example: `{"USER": "elastic","LANG": "en_US.UTF-8","HOME": "/home/elastic"}`
example: `["PATH=/usr/local/bin:/usr/bin", "USER=ubuntu"]`

| extended

Expand Down
11 changes: 6 additions & 5 deletions experimental/generated/beats/fields.ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5549,12 +5549,13 @@
default_field: false
- name: env_vars
level: extended
type: object
description: 'Environment variables (`env_vars`) set at the time of the event.
May be filtered to protect sensitive information.
type: keyword
ignore_above: 1024
description: 'Array of environment variable bindings. Captured from a snapshot
of the environment at the time of execution.
The field should not contain nested objects. All values should use `keyword`.'
example: '{"USER": "elastic","LANG": "en_US.UTF-8","HOME": "/home/elastic"}'
May be filtered to protect sensitive information.'
example: '["PATH=/usr/local/bin:/usr/bin", "USER=ubuntu"]'
default_field: false
- name: executable
level: extended
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 @@ -613,7 +613,7 @@ ECS_Version,Indexed,Field_Set,Field,Type,Level,Normalization,Example,Description
8.6.0-dev+exp,true,process,process.entry_leader.user.name.text,match_only_text,core,,a.einstein,Short name or login of the user.
8.6.0-dev+exp,true,process,process.entry_leader.working_directory,keyword,extended,,/home/alice,The working directory of the process.
8.6.0-dev+exp,true,process,process.entry_leader.working_directory.text,match_only_text,extended,,/home/alice,The working directory of the process.
8.6.0-dev+exp,true,process,process.env_vars,object,extended,,"{""USER"": ""elastic"",""LANG"": ""en_US.UTF-8"",""HOME"": ""/home/elastic""}",Environment variables set at the time of the event.
8.6.0-dev+exp,true,process,process.env_vars,keyword,extended,array,"[""PATH=/usr/local/bin:/usr/bin"", ""USER=ubuntu""]",Array of environment variable bindings.
8.6.0-dev+exp,true,process,process.executable,keyword,extended,,/usr/bin/ssh,Absolute path to the process executable.
8.6.0-dev+exp,true,process,process.executable.text,match_only_text,extended,,/usr/bin/ssh,Absolute path to the process executable.
8.6.0-dev+exp,true,process,process.exit_code,long,extended,,137,The exit code of the process.
Expand Down
16 changes: 9 additions & 7 deletions experimental/generated/ecs/ecs_flat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7947,17 +7947,19 @@ process.entry_leader.working_directory:
process.env_vars:
beta: This field is beta and subject to change.
dashed_name: process-env-vars
description: 'Environment variables (`env_vars`) set at the time of the event. May
be filtered to protect sensitive information.
description: 'Array of environment variable bindings. Captured from a snapshot of
the environment at the time of execution.

The field should not contain nested objects. All values should use `keyword`.'
example: '{"USER": "elastic","LANG": "en_US.UTF-8","HOME": "/home/elastic"}'
May be filtered to protect sensitive information.'
example: '["PATH=/usr/local/bin:/usr/bin", "USER=ubuntu"]'
flat_name: process.env_vars
ignore_above: 1024
level: extended
name: env_vars
normalize: []
short: Environment variables set at the time of the event.
type: object
normalize:
- array
short: Array of environment variable bindings.
type: keyword
process.executable:
dashed_name: process-executable
description: Absolute path to the process executable.
Expand Down
16 changes: 9 additions & 7 deletions experimental/generated/ecs/ecs_nested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9668,17 +9668,19 @@ process:
process.env_vars:
beta: This field is beta and subject to change.
dashed_name: process-env-vars
description: 'Environment variables (`env_vars`) set at the time of the event.
May be filtered to protect sensitive information.
description: 'Array of environment variable bindings. Captured from a snapshot
of the environment at the time of execution.

The field should not contain nested objects. All values should use `keyword`.'
example: '{"USER": "elastic","LANG": "en_US.UTF-8","HOME": "/home/elastic"}'
May be filtered to protect sensitive information.'
example: '["PATH=/usr/local/bin:/usr/bin", "USER=ubuntu"]'
flat_name: process.env_vars
ignore_above: 1024
level: extended
name: env_vars
normalize: []
short: Environment variables set at the time of the event.
type: object
normalize:
- array
short: Array of environment variable bindings.
type: keyword
process.executable:
dashed_name: process-executable
description: Absolute path to the process executable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@
}
},
"env_vars": {
"type": "object"
"ignore_above": 1024,
"type": "keyword"
},
"executable": {
"fields": {
Expand Down
3 changes: 2 additions & 1 deletion experimental/generated/elasticsearch/legacy/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2923,7 +2923,8 @@
}
},
"env_vars": {
"type": "object"
"ignore_above": 1024,
"type": "keyword"
},
"executable": {
"fields": {
Expand Down
11 changes: 6 additions & 5 deletions generated/beats/fields.ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5453,12 +5453,13 @@
default_field: false
- name: env_vars
level: extended
type: object
description: 'Environment variables (`env_vars`) set at the time of the event.
May be filtered to protect sensitive information.
type: keyword
ignore_above: 1024
description: 'Array of environment variable bindings. Captured from a snapshot
of the environment at the time of execution.
The field should not contain nested objects. All values should use `keyword`.'
example: '{"USER": "elastic","LANG": "en_US.UTF-8","HOME": "/home/elastic"}'
May be filtered to protect sensitive information.'
example: '["PATH=/usr/local/bin:/usr/bin", "USER=ubuntu"]'
default_field: false
- name: executable
level: extended
Expand Down
2 changes: 1 addition & 1 deletion generated/csv/fields.csv
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ ECS_Version,Indexed,Field_Set,Field,Type,Level,Normalization,Example,Description
8.6.0-dev,true,process,process.entry_leader.user.name.text,match_only_text,core,,a.einstein,Short name or login of the user.
8.6.0-dev,true,process,process.entry_leader.working_directory,keyword,extended,,/home/alice,The working directory of the process.
8.6.0-dev,true,process,process.entry_leader.working_directory.text,match_only_text,extended,,/home/alice,The working directory of the process.
8.6.0-dev,true,process,process.env_vars,object,extended,,"{""USER"": ""elastic"",""LANG"": ""en_US.UTF-8"",""HOME"": ""/home/elastic""}",Environment variables set at the time of the event.
8.6.0-dev,true,process,process.env_vars,keyword,extended,array,"[""PATH=/usr/local/bin:/usr/bin"", ""USER=ubuntu""]",Array of environment variable bindings.
8.6.0-dev,true,process,process.executable,keyword,extended,,/usr/bin/ssh,Absolute path to the process executable.
8.6.0-dev,true,process,process.executable.text,match_only_text,extended,,/usr/bin/ssh,Absolute path to the process executable.
8.6.0-dev,true,process,process.exit_code,long,extended,,137,The exit code of the process.
Expand Down
16 changes: 9 additions & 7 deletions generated/ecs/ecs_flat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7798,17 +7798,19 @@ process.entry_leader.working_directory:
process.env_vars:
beta: This field is beta and subject to change.
dashed_name: process-env-vars
description: 'Environment variables (`env_vars`) set at the time of the event. May
be filtered to protect sensitive information.
description: 'Array of environment variable bindings. Captured from a snapshot of
the environment at the time of execution.

The field should not contain nested objects. All values should use `keyword`.'
example: '{"USER": "elastic","LANG": "en_US.UTF-8","HOME": "/home/elastic"}'
May be filtered to protect sensitive information.'
example: '["PATH=/usr/local/bin:/usr/bin", "USER=ubuntu"]'
flat_name: process.env_vars
ignore_above: 1024
level: extended
name: env_vars
normalize: []
short: Environment variables set at the time of the event.
type: object
normalize:
- array
short: Array of environment variable bindings.
type: keyword
process.executable:
dashed_name: process-executable
description: Absolute path to the process executable.
Expand Down
16 changes: 9 additions & 7 deletions generated/ecs/ecs_nested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9504,17 +9504,19 @@ process:
process.env_vars:
beta: This field is beta and subject to change.
dashed_name: process-env-vars
description: 'Environment variables (`env_vars`) set at the time of the event.
May be filtered to protect sensitive information.
description: 'Array of environment variable bindings. Captured from a snapshot
of the environment at the time of execution.

The field should not contain nested objects. All values should use `keyword`.'
example: '{"USER": "elastic","LANG": "en_US.UTF-8","HOME": "/home/elastic"}'
May be filtered to protect sensitive information.'
example: '["PATH=/usr/local/bin:/usr/bin", "USER=ubuntu"]'
flat_name: process.env_vars
ignore_above: 1024
level: extended
name: env_vars
normalize: []
short: Environment variables set at the time of the event.
type: object
normalize:
- array
short: Array of environment variable bindings.
type: keyword
process.executable:
dashed_name: process-executable
description: Absolute path to the process executable.
Expand Down
3 changes: 2 additions & 1 deletion generated/elasticsearch/composable/component/process.json
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@
}
},
"env_vars": {
"type": "object"
"ignore_above": 1024,
"type": "keyword"
},
"executable": {
"fields": {
Expand Down
3 changes: 2 additions & 1 deletion generated/elasticsearch/legacy/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2857,7 +2857,8 @@
}
},
"env_vars": {
"type": "object"
"ignore_above": 1024,
"type": "keyword"
},
"executable": {
"fields": {
Expand Down
14 changes: 8 additions & 6 deletions schemas/process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,17 @@

- name: env_vars
level: extended
type: object
type: keyword
beta: This field is beta and subject to change.
short: Environment variables set at the time of the event.
short: Array of environment variable bindings.
description: >
Environment variables (`env_vars`) set at the time of the event.
May be filtered to protect sensitive information.
Array of environment variable bindings.
Captured from a snapshot of the environment at the time of execution.

The field should not contain nested objects. All values should use `keyword`.
example: "{\"USER\": \"elastic\",\"LANG\": \"en_US.UTF-8\",\"HOME\": \"/home/elastic\"}"
May be filtered to protect sensitive information.
example: "[\"PATH=/usr/local/bin:/usr/bin\", \"USER=ubuntu\"]"
normalize:
- array

- name: entry_meta.type
level: extended
Expand Down

0 comments on commit ad61000

Please sign in to comment.