Create new beat based on libbeat 6.1?


What is/will be the preferred way of creating a new go application that uses libbeat 6.1?

  1. The official documentation says to generate the new project using the cookie cutter template:

make setup just copies the content of the libbeat from GOPATH to the vendor folder.

Drawbacks: vendor/ is not managed by govendor tool

  1. use govendor tool
    I followed the same setup as

Drawbacks: needs to hack the vendor/vendor.json file to update the origin.
It doesn't work out of the box

My steps:

govendor fetch$(BEATS_VERSION)
govendor fetch$(BEATS_VERSION)
scripts/ --done

scripts/ patches the vendor.json (created by govendor fetch to set the origin of all packages to

Without this patch, the script does nothing

However, there are still some issues.
For instance, make set_version 1.2.3 does not work because it expects set_version python file to be in ./vendor/ But the file is now in ./_beats/dev-tools/set_version

Both solutions no longer work out of the box!
I can submit PR but I need guidance on the best way to create/update new projects.

Let me start by sharing few thoughts on why I did the script for apm-server. For me it was important to separate the golang files from what I would call the framework part. The go dependencies should be managed by whatever dependency tool is used. For the framework part we need some special inclusion / exclusion to make sure all needed files are there but not too many.

For the apm-server case the set-version is not relevant as it is tied to the Elastic Stack version. But I remember in your case you need to overwrite it, so yes this part is broken and we should find a fix for it. Potentially a variable that defines where the script is could help (as we did for quite a few other things).

Moving forward I think we should make the beats-update script part of generator and find some tricks to also make the set-version work again. More then happy to review PR's on this :wink: I wanted to do the first part myself for some time but never got to it.

This topic was automatically closed after 21 days. New replies are no longer allowed.