Skip to content
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

Introduce "external" property for fields #179

Merged
merged 6 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/go/internal/spec/statik.go

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions test/packages/good/data_stream/foo/fields/external-fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: event
type: group
description: Event family
fields:
- name: category
source: ecs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kind of a nitpick but I still want to mention it. The term source comes with a lot of baggage. It has some history in filebeat and is also used in ecs.

Do we expect any other source in the future? Or could we start with ecs: true or something like that for now?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative name: reference: ecs ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we expect any other source in the future?

Yes, as described in #63 (comment) . We'd like to introduce similar fields schema for Agent's fields.

Alternative name: reference: ecs ?

I can adjust to reference. I wasn't aware of the history.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed, although I believe this is more like personal preference.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, not happy with both names :-D Especially as source sounds technically more correct. Maybe it is just me that gets reminded of all the history here.

5 changes: 4 additions & 1 deletion versions/1/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,7 @@
link: https://github.com/elastic/package-spec/pull/175
- description: Define common test config for pipeline tests
type: enhancement
link: https://github.com/elastic/package-spec/pull/176
link: https://github.com/elastic/package-spec/pull/176
- description: Introduce "source" property for fields
type: enhancement
link: https://github.com/elastic/package-spec/pull/179
8 changes: 6 additions & 2 deletions versions/1/data_stream/fields/fields.spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ spec:
type: string
examples:
- '^[a-zA-Z]$'
source:
description: External source
type: string
enum:
- ecs
fields:
description: Sub-fields, when type is group
$ref: "#" # JSON-schema syntax for pointing to the root of the schema
required:
- name
- type
- name