Skip to content

Commit

Permalink
Merge pull request elastic#4942 from dedemorton/cherrypick_docs_08.17.17
Browse files Browse the repository at this point in the history
Backport to 6.0: Config reload docs
  • Loading branch information
dedemorton authored Aug 18, 2017
2 parents d914b75 + 7794d9b commit 15467f6
Showing 1 changed file with 64 additions and 15 deletions.
79 changes: 64 additions & 15 deletions filebeat/docs/reload-configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,49 @@

beta[]

You can configure Filebeat to dynamically reload prospector configuration files
when there are changes. To do this, you specify a path
(https://golang.org/pkg/path/filepath/#Glob[Glob]) to watch for prospector
configuration changes. When the files found by the Glob change, new prospectors
are started/stopped according to changes in the configuration files.
You can configure Filebeat to dynamically reload configuration files when there
are changes. This feature is available for prospector and module configuration
files only.

To configure this feature, you specify a path
(https://golang.org/pkg/path/filepath/#Glob[Glob]) to watch for configuration
changes. When the files found by the Glob change, new prospectors and/or
modules are started and stopped according to changes in the configuration files.

This feature is especially useful in container environments where one container
is used to tail logs for services running in other containers on the same host.

To enable dynamic config reloading, you specify the `path` and `reload` options
in the `filebeat.config.prospectors` section of the main `filebeat.yml` config
file. For example:
To enable dynamic config reloading, you specify the following options under
`filebeat.config.prospectors` (for prospector configs) or
`filebeat.config.modules` (for module configs):

`path`:: A Glob that defines the files to check for changes.
`reload.enabled`:: When set to `true`, enables dynamic config reload.
`reload.period`:: Specifies how often the files are checked for changes. Do not
set the `period` to less than 1s because the modification time of files is often
stored in seconds. Setting the `period` to less than 1s will result in
unnecessary overhead.

See <<reload-prospector-config>> and <<reload-module-config>> for examples.


[float]
[[reload-prospector-config]]
=== Prospector config

For prospector configurations, you specify reload options in the
`filebeat.config.prospectors` section of the +{beatname_lc}.yml+ file. For
example:

[source,yaml]
------------------------------------------------------------------------------
filebeat.config.prospectors:
enabled: true
path: configs/*.yml
reload.enabled: true
reload.period: 10s
------------------------------------------------------------------------------

`path`:: A Glob that defines the files to check for changes.
`reload.enabled`:: When set to `true`, enables dynamic config reload.
`reload.period`:: Specifies how often the files are checked for changes. Do not
set the `period` to less than 1s because the modification time of files is often
stored in seconds. Setting the `period` to less than 1s will result in
unnecessary overhead.

Each file found by the Glob must contain a list of one or more prospector
definitions. For example:

Expand All @@ -47,6 +62,40 @@ definitions. For example:
scan_frequency: 5s
------------------------------------------------------------------------------


WARNING: It is critical that two running prospectors DO NOT have overlapping
file paths defined. If more than one prospector harvests the same file at the
same time, it can lead to unexpected behaviour.

[float]
[[reload-module-config]]
=== Module config

For module configurations, you specify reload options in the
`filebeat.config.modules` section of the +{beatname_lc}.yml+ file. For example:

[source,yaml]
------------------------------------------------------------------------------
filebeat.config.modules:
enabled: true
path: prospectors.d/*.yml <1>
reload.enabled: true
reload.period: 10s
------------------------------------------------------------------------------
<1> If you change the path setting to look for config changes in a different
directory, you will not be able to use the <<modules-command,`modules`>> command
to enable and disable module configurations.

Each file found by the Glob must contain a list of one or more module
definitions. For example:

[source,yaml]
------------------------------------------------------------------------------
- module: apache2
access:
enabled: true
var.paths: [/var/log/apache2/access.log*]
error:
enabled: true
var.paths: [/var/log/apache2/error.log*]
------------------------------------------------------------------------------

0 comments on commit 15467f6

Please sign in to comment.