WARNING: Version 5.6 of Beats has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Getting Ready
editGetting Ready
editAll Beats are written in Go, so having Go installed and knowing the basics are prerequisites for understanding this guide. But don’t worry if you aren’t a Go expert. Go is a relatively new language, and very few people are experts in it. In fact, several people learned Go by contributing to Packetbeat and libbeat, including the original Packetbeat authors.
For general information about contributing to Beats, see our Contributing Guide.
After you have installed Go and set up the GOPATH environment variable to point to your preferred workspace location, a simple way of getting the source code for Beats, including libbeat and the Beat generator, is to do:
go get github.com/elastic/beats
When you run the command, all source files are downloaded to the
$GOPATH/src/github.com/elastic/beats
path. You can ignore the "no buildable Go source files" message because
you will build the source later. By default go get
fetches the master branch. To build your beat
on a specific version of libbeat, check out the specific branch (5.6 in the example below):
cd ${GOPATH}/src/github.com/elastic/beats git checkout 5.6
Note: If you have multiple go paths use ${GOPATH%%:*}`instead of `${GOPATH}
.