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

Import fields.ecs.yml as generated by the ECS repo #11150

Merged
merged 7 commits into from
Mar 11, 2019

Conversation

webmat
Copy link
Contributor

@webmat webmat commented Mar 8, 2019

This PR is based on elastic/ecs#379. Once this ECS issue is merged and backported to the 1.0 branch in ECS, a final export of the fields should be imported in this PR.

A few things of note:

  • This new file doesn't include agent.hostname, which is not an ECS field. So this field definition has been moved to fields.common.yml.
  • This generated file now includes user.* reusable fields under client, destination, server and source. They previously had been missed.
  • This file now includes the geo fieldset at host.geo.* and observer.geo.*. They previously had been missed.
  • This imports the various adjustments to definitions that came between ECS 1.0.0-beta2 and 1.0.0.
  • The warning will mention ECS version 1.0.0 instead of 1.1.0-dev, once the file is generated from the ECS 1.0 branch.

Update

This is now based on the ECS v1.0 backport PR elastic/ecs#381.

This is ready for final review.

  • Backport to 7.0 and 7.x

@webmat webmat requested a review from a team as a code owner March 8, 2019 03:30
@webmat webmat self-assigned this Mar 8, 2019
@webmat webmat added needs backport in progress Pull request is currently in progress. labels Mar 8, 2019
@webmat
Copy link
Contributor Author

webmat commented Mar 8, 2019

Here's a tip if you want to diff the previous file with this one. It doesn't help for the array sort order differences, but it helps for the YAML formatting differences and key order in YAML dictionaries.

Using Python 2.7 (so the dictionaries are sorted by key):

# on 7.0 branch
cat libbeat/_meta/fields.ecs.yml | python -c 'import sys; import yaml; print(yaml.dump(yaml.load(sys.stdin.read()),default_flow_style=False))' > ~/before.yml
# on this PR/branch
cat libbeat/_meta/fields.ecs.yml | python -c 'import sys; import yaml; print(yaml.dump(yaml.load(sys.stdin.read()),default_flow_style=False))' > ~/after.yml

@webmat webmat requested a review from a team as a code owner March 8, 2019 03:55
Mathieu Martin added 2 commits March 8, 2019 06:50
- with agent.hostname fix
- and warning header that includes the version
@ycombinator
Copy link
Contributor

Hey @webmat, this is the only PR (open or closed) in the beats repo that is using the needs backport label instead of the needs_backport label. I'm guessing that was a typo? Is it okay if we switch the label on this PR and then delete the needs backport label from the repo?

@webmat
Copy link
Contributor Author

webmat commented Mar 8, 2019

@ycombinator Nah, the space instead of the underscore is really important :trollface:

@webmat webmat added needs_backport PR is waiting to be backported to other branches. and removed needs backport labels Mar 8, 2019
@webmat
Copy link
Contributor Author

webmat commented Mar 8, 2019

I used "needs backport" in ECS, and I open my PRs with hub instead of the web interface.

Will adjust to needs_backport in my things :-) Thanks for pointing out

@webmat webmat changed the title WIP Import fields.ecs.yml as generated by the ECS repo. Import fields.ecs.yml as generated by the ECS repo Mar 8, 2019
No harm was done to the fields between 1.0 and master
@webmat webmat added review and removed in progress Pull request is currently in progress. labels Mar 8, 2019
@webmat
Copy link
Contributor Author

webmat commented Mar 8, 2019

This is now based on the ECS v1.0 backport PR elastic/ecs#381.

This is ready for final review.

Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

LGTM. A follow up PR should be done to update the ecs version in each event.

One thing that keeps bugging me is that each Beat gets all ECS fields even if they are not used which leads to a much larger template then needed. This "should" not be a technical issue but I think it could be confusing for users to see fields in the template that are not used. The benefit of it is that users can't introduce fields which conflict with ECS in Beats with the rename processor for example. As you see, I'm on the fence. But this is for a later discussion, it just popped up because more fields are added here to each Beat.

@andrewkroh
Copy link
Member

The vendored copy of the generated Go code should get updated too.

govendor fetch github.com/elastic/ecs/code/go/ecs@<tag>

@webmat
Copy link
Contributor Author

webmat commented Mar 11, 2019

@ruflin I'll open the follow-up PR shortly, to set the version on the events. Didn't want the massive amounts of test JSON files conflicting with all the other PRs to slow down the merge of this straightforward field update :-)

@andrewkroh The code generation hasn't been backported to 1.0 yet, but I should be able to get that done and open a PR here today.

@webmat webmat merged commit c33cb27 into elastic:master Mar 11, 2019
@webmat
Copy link
Contributor Author

webmat commented Mar 11, 2019

Upon further inspection, it appears that libbeat/publisher/pipeline/module.go no longer sets the ECS version on the events.

Is this now solely based on the vendored Go ECS library's Version constant?

webmat added a commit to webmat/beats that referenced this pull request Mar 11, 2019
Moved the definition of `agent.hostname` to fields.common.yml
@webmat webmat added the ecs label Mar 11, 2019
webmat added a commit to webmat/beats that referenced this pull request Mar 11, 2019
Moved the definition of `agent.hostname` to fields.common.yml
webmat added a commit that referenced this pull request Mar 11, 2019
… repo (#11150) (#11178)

Backport of PR #11150 to 7.0 branch. Original message:

Moved the definition of `agent.hostname` to fields.common.yml
@ruflin
Copy link
Member

ruflin commented Mar 12, 2019

@webmat Yes, looks like it depends on the go lib.

webmat pushed a commit to webmat/beats that referenced this pull request Mar 14, 2019
They were accidentally removed by elastic#11150.
webmat added a commit that referenced this pull request Mar 14, 2019
webmat added a commit to webmat/beats that referenced this pull request Mar 14, 2019
webmat added a commit that referenced this pull request Mar 14, 2019
DStape pushed a commit to DStape/beats that referenced this pull request Aug 20, 2019
Moved the definition of `agent.hostname` to fields.common.yml
DStape pushed a commit to DStape/beats that referenced this pull request Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecs needs_backport PR is waiting to be backported to other branches. review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants