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.4: Simplify fields.yml generator #7777

Merged
merged 2 commits into from
Sep 25, 2018

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Jul 27, 2018

Cherry-pick of PR #7713 to 6.4 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

@jsoriano
Copy link
Member

Failures in tests are fixed by #8425

kvch and others added 2 commits September 25, 2018 12:51
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 kvch force-pushed the backport_7713_6.4 branch from 0336e51 to dce6a0d Compare September 25, 2018 10:51
@kvch
Copy link
Contributor Author

kvch commented Sep 25, 2018

Rebased to include all fixes.

@kvch kvch merged commit 357d046 into elastic:6.4 Sep 25, 2018
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…ic#7777)

* Simplify fields.yml generator (elastic#7713)

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 ec2e022)

* update fields of Packetbeat
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