WARNING: Version 5.1 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.
Generating Your Beat
editGenerating Your Beat
editTo generate your own Beat, you use the Beat generator available in the beats repo on GitHub. If you haven’t downloaded the Beats source code yet, follow the instructions in Getting Ready.
Before running the Beat generator, you must install cookiecutter, a
command-line utility that creates projects from project templates. Check out the
installation guide. After installing cookiecutter,
decide on a name for your beat. The name should be one word with the first letter capitalized. In our example,
we use Countbeat
.
Now create a directory under $GOPATH for your repository and change to the new directory:
mkdir $GOPATH/src/github.com/{user} cd $GOPATH/src/github.com/{user}
Run cookiecutter and specify the path to the Beat generator:
cookiecutter $GOPATH/src/github.com/elastic/beats/generate/beat
Cookiecutter will prompt you to enter information about your Beat. For the project_name
, enter Countbeat
.
For the github_name
, enter your github id. The beat
and beat_path
are set to the correct values automatically (just press Enter to accept each default). For the full_name
, enter your firstname and lastname.
project_name [Examplebeat]: Countbeat github_name [your-github-name]: {username} beat [countbeat]: beat_path [github.com/{github id}]: full_name [Firstname Lastname]: {Full Name}
The Beat generator creates a directory called countbeat
inside of your project folder.
You now have a raw template of the Beat, but you still need to fetch dependencies and set up the Beat.