The current implementation of libbeat does not fully support setting a version number for the community beat apps.
If you are happy with the following changes, I am going to implement them right away
##Suggested changes:
mybeat/main.go
(This file is generated by the community beat generator)
Community beat application specifies its own version
func main() {
err := beat.Run("myapp", appVersion, beater.New)
if err != nil {
os.Exit(1)
}
}
or the Community beat application reuses the version from libbeat
func main() {
err := beat.Run("myapp", "", beater.New)
if err != nil {
os.Exit(1)
}
}
mybeat/version.go (optional)
- This file is optional, only used when the community beat application specifies its own version
- This file is updated by set_version script
Content:
package main
const appVersion = "0.1.0-alpha1"
mybeat/version.yml (optional)
- This file is optional, only used when the community beat application specifies its own version
- This file is updated by set_version script
Content:
version: "0.1.0-alpha1"
github.com/elastic/beats/libbeat/scripts/Makefile
Paths can be specified through VERSION_GOFILEPATH
and VERSION_YAMLFILEPATH
environment variables.
Default values:
-
VERSION_GOFILEPATH
=github.com/elastic/beats/libbeat/beat/version.go
-
VERSION_YAMLFILEPATH
=github.com/elastic/beats/dev-tools/packer/version.yml
github.com/elastic/beats/dev-tools/get_version / set_version
Changes the scripts to use the paths of version.go
and version.yml
as specified by the environment variables .