How to compile beats


(Cory Marsh) #1

TL;DR: Is there a doc or wiki page on how to compile? I'm sure it's something simple and obvious, but I don't even know what to try or what to read at this point

So I have been struggling trying to get libbeat to compile. I am new to go programming so some of this might be obvious to people who have been developing go for a while. It seems like I'm supposed to copy the libbeats source code into my "src" directory in my go install(/usr/local/go)? Is that right?

That seems really messy. If I clone into a new directory (/code/security/beats), after I get docker 1.19 running, this is what make gives me:

/code/security/beats$ echo $GOPATH
/code/security/beats
/code/security/beats$ echo $GOROOT
/usr/local/go
/usr/local/go$ cat VERSION
go1.5.2
/code/security/beats$ uname -a
Linux infosec3 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
/code/security/beats)$ zsh --version
zsh 5.0.2 (x86_64-pc-linux-gnu)
/code/security/beats$ git pull
remote: Counting objects: 81, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 81 (delta 49), reused 49 (delta 49), pack-reused 30
Unpacking objects: 100% (81/81), done.
From https://github.com/elastic/beats
Updating 1873d72..e58f861
Fast-forward
/code/security/beats$ make
....
...
make[2]: Entering directory /code/security/beats/libbeat' go test -c -covermode=atomic -coverpkg ./... libbeat.go:4:2: cannot find package "github.com/elastic/beats/libbeat/beat" in any of: /usr/local/go/src/github.com/elastic/beats/libbeat/beat (from $GOROOT) /code/security/beats/src/github.com/elastic/beats/libbeat/beat (from $GOPATH) libbeat.go:5:2: cannot find package "github.com/elastic/beats/libbeat/mock" in any of: /usr/local/go/src/github.com/elastic/beats/libbeat/mock (from $GOROOT) /code/security/beats/src/github.com/elastic/beats/libbeat/mock (from $GOPATH) make[2]: *** [libbeat.test] Error 1 make[2]: Leaving directory/code/security/beats/libbeat'

I read another post that seemed to indicate that libbeat needs to be copied into /usr/local/go/src/github.com/elastic/beats/libbeat/beat. Is that right? If so, which directory needs to be copied where and which make file should I be using or should I not even be using make ?

  • Frustrated Cory

(Andrew Kroh) #2

The contributing guide should answer your questions.

If you have any questions after reading it, please ask.


(system) #3