Please help: Create new beats


(Rafaelbattesti) #1

Hello elastic community.

I am starting off a project around Beats and trying to first setup my environment.
I followed the steps on: https://www.elastic.co/guide/en/beats/devguide/master/new-beat.html

But the result was:

RAFAELB-MAC:indellient rafaelb$ python $GOPATH/src/github.com/elastic/beats/script/generate.py
Beat Name [Examplebeat]: Awesomebeat
Your Github Name [your-github-name]: rafaelbattesti
Beat Path [github.com/rafaelbattesti/awesomebeat]: github.com/indellient/awesomebeat
Firstname Lastname: Rafael Battesti
RAFAELB-MAC:indellient rafaelb$ cd awesomebeat/
RAFAELB-MAC:awesomebeat rafaelb$ python --version
Python 2.7.10
RAFAELB-MAC:awesomebeat rafaelb$ virtualenv --version
16.2.0
RAFAELB-MAC:awesomebeat rafaelb$ make setup
mkdir -p vendor/github.com/elastic
cp -R /Users/rafaelb/Go/src/github.com/elastic/beats vendor/github.com/elastic/
rm -rf vendor/github.com/elastic/beats/.git vendor/github.com/elastic/beats/x-pack
mkdir -p vendor/github.com/magefile
cp -R /Users/rafaelb/Go/src/github.com/elastic/beats/vendor/github.com/magefile/mage vendor/github.com/magefile
git init
Initialized empty Git repository in /Users/rafaelb/Go/src/github.com/indellient/awesomebeat/.git/
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f ./vendor/github.com/elastic/beats/libbeat/scripts/Makefile mage
./vendor/github.com/elastic/beats/libbeat/scripts/Makefile:99: ../dev-tools/make/mage.mk: No such file or directory
make[1]: *** No rule to make target `../dev-tools/make/mage.mk'.  Stop.
make: *** [pre-setup] Error 2

[EDIT]

RAFAELB-MAC:awesomebeat rafaelb$ go version
go version go1.11.2 darwin/amd64
RAFAELB-MAC:awesomebeat rafaelb$ echo $GOPATH
/Users/rafaelb/Go
RAFAELB-MAC:awesomebeat rafaelb$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/rafaelb/DevOpsTools:/Users/rafaelb/Go/bin:/Users/rafaelb/DevOpsTools:/Users/rafaelb/Go/bin
RAFAELB-MAC:awesomebeat rafaelb$

Thanks!


(Rafaelbattesti) #2

[SOLVED]

  1. Manually install magefile
    $ go get github.com/magefile/mage

  2. Change path in github.com/elastic/beats/libbeat/scripts/Makefile:15

Instead of:
ES_BEATS?=..## @community_beat Must be set to ./vendor/github.com/elastic/beats. It must always be a relative path.

Use:
ES_BEATS?=vendor/github.com/elastic/beats## @community_beat Must be set to ./vendor/github.com/elastic/beats. It must always be a relative path.

Make sure you leave no spaces between beats and ##. This was causing make setup to fail such as below.

make[1]: *** vendor/github.com/elastic/beats: Is a directory.  Stop.
make: *** [pre-setup] Error 2

Make implementation:

RAFAELB-MAC:awesomebeat rafaelb$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

(Michael) #3

It would be nice if the documentation could be updated to address this. Attempting to build a new beat on CentOS 7 fails using the current guide.


(Rafaelbattesti) #4

It's also still failing to make the community Beat. I believe there are changes to the code which should be addressed.


(system) closed #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.