-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify beat generator and metricset generator (#2015)
* Replace git clone by go get command. This shows if golang was setup correctly * Update the docs with the new changes * Enhance and simplify packaging
- Loading branch information
1 parent
420ae9e
commit c5c2ada
Showing
10 changed files
with
163 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
[[creating-your-beat]] | ||
== Creating your own Beat | ||
|
||
The Beat generator enables you to create your own Beat in a few steps. | ||
|
||
[float] | ||
=== Requirements | ||
|
||
To create your own Beat, you must have Golang 1.6.2 or later installed, and the `$GOPATH` | ||
must be set up correctly. In addition, the following tools are quired: | ||
|
||
* https://www.python.org/downloads/[python] | ||
* https://virtualenv.pypa.io/en/stable/[virtualenv] | ||
* https://github.com/audreyr/cookiecutter[cookiecutter] | ||
|
||
Virtualenv and Cookiecutter are easiest installed with your package manager or https://pip.pypa.io/en/stable/[pip]. For more details on how to | ||
install cookiecutter, see the http://cookiecutter.readthedocs.io/en/latest/installation.html[cookiecutter installation docs]. | ||
|
||
|
||
[float] | ||
=== Step 1 - Get the libbeat source code | ||
|
||
The first step is to get the libbeat source code: | ||
|
||
[source,bash] | ||
---- | ||
go get github.com/elastic/beats/libbeat | ||
---- | ||
|
||
This will clone the beats repository into `GOPATH`. Now change to the directory where you want to create the beat. | ||
This directory is normally located under `$GOPATH/src/github.com/{your-github-name}`. Inside this directory, run the command to create the beat. | ||
|
||
|
||
[float] | ||
=== Step 2 - Create the Beat | ||
|
||
Run the command: | ||
|
||
[source,bash] | ||
---- | ||
cookiecutter $GOPATH/src/github.com/elastic/beats/generate/beat | ||
---- | ||
|
||
When prompted, enter the Beat name and path. | ||
|
||
|
||
[float] | ||
=== Step 3 - Init and create the metricset | ||
|
||
After creating the Beat, change the directory to `$GOPATH/src/github.com/{your-github-name}/{beat}` and run: | ||
|
||
[source,bash] | ||
---- | ||
make setup | ||
---- | ||
|
||
This will do the initial setup for your Beat. | ||
|
||
For more details about creating a beat, see the https://www.elastic.co/guide/en/beats/libbeat/current/new-beat.html[beat developer docs]. | ||
|
||
|
||
[float] | ||
=== Step 4 - Build & Run | ||
|
||
To create a binary run the `make` command. This will create the binary in your beats directory. | ||
|
||
To run it, execute the binary. This will automatically load the default configuration which was generated by `make update`. | ||
|
||
[source,bash] | ||
---- | ||
./beatname -e -d "*" | ||
---- | ||
|
||
This will run the beat with debug output enabled to the console to directly see what is happening. Stop the beat with `CTRL-C`. | ||
|
||
[float] | ||
=== Step 5 - Package | ||
|
||
To create packages and binaries for different plaforms, https://www.docker.com/[docker] is required. | ||
The first step is to get the most recent packaging tools into your beat: | ||
|
||
[source,bash] | ||
---- | ||
make package | ||
---- | ||
|
||
This will fetch the most recent packaging tools and start the packaging of your beat. This can take a little bit longer. | ||
|
||
|
||
For more details about creating a beat, see the https://www.elastic.co/guide/en/beats/libbeat/current/new-beat.html[beat developer docs]. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters