-
Notifications
You must be signed in to change notification settings - Fork 91
Stricter validation of data stream settings #587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jsoriano
merged 9 commits into
elastic:main
from
jsoriano:validate-data-stream-settings
Sep 11, 2023
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
043d972
Stricter validation of data stream settings
jsoriano 77c7c0c
Temporarily remove make test for integration tests
jsoriano 523c623
Revert "Temporarily remove make test for integration tests"
jsoriano 709751c
Add default_metric
jsoriano 0383e6b
Merge remote-tracking branch 'origin/main' into validate-data-stream-…
jsoriano 7e56432
Fix test packages, add patch and changelog
jsoriano 2d31fd8
Fix integers in spec
jsoriano d946169
Add exception for mappings imported from ECS
jsoriano e71560a
Remove leftover
jsoriano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| "a": "data file containing json" | ||
| } | ||
| "a": "data file containing json" | ||
| } |
7 changes: 7 additions & 0 deletions
7
test/packages/good_v3/data_stream/ecs_import_mappings/agent/stream/stream.yml.hbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| paths: | ||
| {{#each paths as |path i|}} | ||
| - {{path}} | ||
| {{/each}} | ||
| exclude_files: [".gz$"] | ||
| processors: | ||
| - add_locale: ~ |
10 changes: 10 additions & 0 deletions
10
...ackages/good_v3/data_stream/ecs_import_mappings/elasticsearch/ingest_pipeline/default.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| description: Pipeline for processing sample logs | ||
| processors: | ||
| - set: | ||
| field: sample_field | ||
| value: "1" | ||
| on_failure: | ||
| - set: | ||
| field: error.message | ||
| value: '{{ _ingest.on_failure_message }}' |
12 changes: 12 additions & 0 deletions
12
test/packages/good_v3/data_stream/ecs_import_mappings/fields/base-fields.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| - name: data_stream.type | ||
| type: constant_keyword | ||
| description: Data stream type. | ||
| - name: data_stream.dataset | ||
| type: constant_keyword | ||
| description: Data stream dataset. | ||
| - name: data_stream.namespace | ||
| type: constant_keyword | ||
| description: Data stream namespace. | ||
| - name: '@timestamp' | ||
| type: date | ||
| description: Event timestamp. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this mapping definition, when
import_mappingsis true in_dev/build/build.ymlin a package, all the mappings defined in this file are added in the built package:https://github.com/elastic/elastic-package/blob/9d80c6cc282d04f521cd763abd42d529f9679cce/internal/builder/_static/ecs_mappings.yaml#L19
Checking those mappings, at least
match,path_matchandfieldsfields are defined undermappingkey too. Some examples:These definitions would be in the built package, and this built package is going to be checked by our publishing CI jobs to validate them before publishing them.
So I guess more fields would be needed here, wouldn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added exception for these fields in d946169.