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

Cherry-pick #7713 to 6.x: Simplify fields.yml generator #7778

Merged
merged 1 commit into from
Jul 30, 2018

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Jul 27, 2018

Cherry-pick of PR #7713 to 6.x branch. Original message:

This PR simplifies the process of generating a new fields.yml file for a Beat.

  • libbeat/fields.yml is not a dependency anymore
  • only fields.yml is written to disk

Changes in the asset files are due to different number of newlines in generated fields.yml files.

Interface changes of generator tools

Both dev-tools/cmd/asset/asset.go and libbeat/scripts/cmd/global_fields/main.go is changed. The first one has two new flags: -in, and -out. By default it reads from stdin and writes to stdout. Using the flags it's possible to read and write from other files. The second one has one new flag -out which specifies the output file. If it's not set, the output is written to stdout.

This makes it possible to generate asset files for Metricbeat without writing libbeat/fields.yml to disk. It will be useful in the future when more Beats have modular assets.

Closes #7671

This PR simplifies the process of generating a new `fields.yml` file for a Beat.
* `libbeat/fields.yml` is not a dependency anymore
* only `fields.yml` is written to disk

Changes in the asset files are due to different number of newlines in generated `fields.yml` files.

### Interface changes of generator tools
Both `dev-tools/cmd/asset/asset.go` and `libbeat/scripts/cmd/global_fields/main.go` is changed. The first one has two new flags: `-in`, and `-out`. By default it reads from stdin and writes to stdout. Using the flags it's possible to read and write from other files. The second one has one new flag `-out` which specifies the output file. If it's not set, the output is written to stdout.

This makes it possible to generate asset files for Metricbeat without writing `libbeat/fields.yml` to disk. It will be useful in the future when more Beats have modular assets.

Closes elastic#7671
(cherry picked from commit 5797005)
@kvch
Copy link
Contributor Author

kvch commented Jul 27, 2018

Duplicate.

@kvch kvch closed this Jul 27, 2018
@kvch kvch reopened this Jul 27, 2018
@ruflin ruflin merged commit b514530 into elastic:6.x Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants