forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate configuration from mage for all Beats (elastic#12618)
From now on all Beats use `mage` when generating configuration files. This comes with the following changes: * Heartbeat does not use `post_process_config.py` to modify processors, instead it is added using the templating * Functionbeat does not include unsupported outputs * All Beats can alter the common configuration coming from `libbeat`. ### What does it mean for Community Beats? When adopting this version of `libbeat`, you need to make sure that you have a target named `Config` in your `magefile.go`. An example target which generates a sample configuration, a reference configuration and a Docker configuration from `{yourbeat}/_meta/beat.yml` and the common configuration from `libbeat` is the following: ```golang import devtools "github.com/elastic/beats/dev-tools/mage" func Config() error { return devtools.Config(devtools.AllConfigTypes, devtools.ConfigFileParams{}, ".") } ``` If the configuration of your Beat consists of multiple files, you can pass your own instance of `ConfigFileParams`: ```golang func ConfigFileParams() devtools.ConfigFileParams { return devtools.ConfigFileParams{ ShortParts: []string{ devtools.OSSBeatDir("_meta/beat.yml"), devtools.OSSBeatDir("_meta/beat.custom.yml"), devtools.LibbeatDir("_meta/config.yml.tmpl"), }, ReferenceParts: []string{ devtools.OSSBeatDir("_meta/beat.reference.yml"), devtools.OSSBeatDir("_meta/beat.custom.referenceyml"), devtools.LibbeatDir("_meta/config.reference.yml.tmpl"), }, DockerParts: []string{ devtools.OSSBeatDir("_meta/beat.docker.yml"), devtools.LibbeatDir("_meta/config.docker.yml"), }, } } ``` It is also possible to pass variables to the templates using the `ExtraVars` attribute of `ConfigFileParams` struct.
- Loading branch information
Showing
4 changed files
with
68 additions
and
13 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,52 @@ | ||
###################### Journalbeat Configuration Example ######################### | ||
|
||
# This file is an example configuration file highlighting only the most common | ||
# options. The journalbeat.reference.yml file from the same directory contains all the | ||
# supported options with more comments. You can use it as a reference. | ||
# | ||
# You can find the full configuration reference here: | ||
# https://www.elastic.co/guide/en/beats/journalbeat/index.html | ||
|
||
# For more available modules and options, please see the journalbeat.reference.yml sample | ||
# configuration file. | ||
|
||
#=========================== Journalbeat inputs ============================= | ||
|
||
journalbeat.inputs: | ||
# Paths that should be crawled and fetched. Possible values files and directories. | ||
# When setting a directory, all journals under it are merged. | ||
# When empty starts to read from local journal. | ||
- paths: [] | ||
|
||
# The number of seconds to wait before trying to read again from journals. | ||
#backoff: 1s | ||
# The maximum number of seconds to wait before attempting to read again from journals. | ||
#max_backoff: 20s | ||
|
||
# Position to start reading from journal. Valid values: head, tail, cursor | ||
seek: cursor | ||
# Fallback position if no cursor data is available. | ||
#cursor_seek_fallback: head | ||
|
||
# Exact matching for field values of events. | ||
# Matching for nginx entries: "systemd.unit=nginx" | ||
#include_matches: [] | ||
|
||
# Optional fields that you can specify to add additional information to the | ||
# output. Fields can be scalar values, arrays, dictionaries, or any nested | ||
# combination of these. | ||
#fields: | ||
# env: staging | ||
|
||
|
||
#========================= Journalbeat global options ============================ | ||
#journalbeat: | ||
# Name of the registry file. If a relative path is used, it is considered relative to the | ||
# data path. | ||
#registry_file: registry | ||
|
||
#==================== Elasticsearch template setting ========================== | ||
setup.template.settings: | ||
index.number_of_shards: 1 | ||
#index.codec: best_compression | ||
#_source.enabled: false |
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