Failed to create a new Beat

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)

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

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.

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

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.

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

@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

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

What error do you get?

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.

@Jul_Kipli What is your operating system?

Mac OS

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.

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.

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