Failed to create a new Beat


(Romain DEQUIDT) #1

Hi,

I tried to follow the instructions from:
https://www.elastic.co/guide/en/beats/libbeat/current/newbeat-generate.html

I executed the following command:
cookiecutter $GOPATH/src/github.com/elastic/beats/generate/beat

First time, i got the following error:
A valid repository for "$GOPATH/src/github.com/elastic/beats/generate/beat" could not be found in the following locations: $GOPATH/src/github.com/elastic/beats/generate/beat $GOPATH/go/src/github.com/elastic/beats/generate/beat

So I created a cookiecutter.json file in the "$GOPATH/src/github.com/elastic/beats/generate/beat" directory with few information (i.e. full_name, email, project_name...)

And I got another error:
cookiecutter.exceptions.NonTemplatedInputDirException

This error is meaningless for me.

Why does cookiecutter do not prompt information as written in your documnetation?

May you test this procedure?

Version:
Cookiecutter 1.5.0 from /home/user/.local/lib/python2.7/site-packages (Python 2.7)


(ruflin) #2

There is something wrong in the documentation. It should state that you have to check out branch 5.1, but I couldn't find it anymore :frowning: Have to check what went wrong here.

We remove cookiecutter very recently and are still actively working on making changes. Here is the most recent guide: https://www.elastic.co/guide/en/beats/libbeat/master/newbeat-generate.html


(ruflin) #3

Thanks for reporting this. I opened https://github.com/elastic/beats/pull/3457 to fix this issue.

Let me know if you have other issues creating a beat.


(Romain DEQUIDT) #4

It's not in the guide but in the blog:


(ruflin) #5

Yeah, I backported the change to the 5.2 branch but missed the 5.1 branch. Will do that as soon as I get the time for it.


(Newcoder99) #6

Hi Ruflin,

There is one point I need to mention regarding the link that you have mentioned to generate new beat.
As mentioned by your team in the reference URL that we need to execute beat.py to create custom beat, but before executing the python script they need to make one modification based on the python version.

In helper.py, they are taking user input using raw_input method which has become obsolete if you are using Python3.x.

So, before proceeding beat generation, end user should check the helper.py and make necessary modifications based on Python version.

Thanks


(ruflin) #7

@newcoder99 Thanks for reporting this issue. Could you open a Github issue for that? Our docs state that Python 2.7 is required but we try to keep it compatible with 3.x as obviously lots of people are using 3.x. I hope we can find a fix here that works for 2.7 and 3.x


(Jul Kipli) #8

Make Setup is not working with new version of creating new beat . I have followed below link,
https://www.elastic.co/guide/en/beats/libbeat/master/newbeat-generate.html


(ruflin) #9

What error do you get?


(Jul Kipli) #10

Getting below error, when I do the Make Setup
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
make: *** [copy-vendor] Error 64

please verify Make file. thanks.


(ruflin) #11

@Jul_Kipli What is your operating system?


(Jul Kipli) #12

Mac OS


(Jul Kipli) #13

It is working after i have installed "virtualenv" in on Mac OS.

How do we generate new Beat in Windows environment ? if yes please share me setup or guideline link. thanks.


(ruflin) #14

Glad to hear you got it working.

For the Windows environment, as you realised you can't use the Makefile commands. But the basic structure of a beat is mostly generated by python. What you require afterwards is to call the commands like go build manually. Best check out the commands which are executed by the Makefile and see if you can execute them manually on Windows.

It would be nice if we could offer the beat generator in the future also for Windows, so if you go forward with this it would be interesting to hear which roadblocks you hit.


(system) #15

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