Skip to content

Commit

Permalink
Add filebeat.overwrite_pipelines option (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
TuningYourCode authored Jun 16, 2021
1 parent 5d00759 commit 3bd2a73
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ Installs and configures filebeat.
- `setup`: [Hash] Setup that will be created. Commonly used to create setup using hiera
- `xpack`: [Hash] XPack configuration to pass to filebeat
- `extra_validate_options`: [String] Extra command line options to pass to the configuration validation command.
- `overwrite_pipelines`: [Boolean] If set to true, filebeat will overwrite existing pipelines.

### Private Classes

Expand Down
20 changes: 11 additions & 9 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
'enabled' => $filebeat::enable_conf_modules,
'path' => "${filebeat::modules_dir}/*.yml",
},
'shutdown_timeout' => $filebeat::shutdown_timeout,
'modules' => $filebeat::modules,
'registry' => {
'modules' => $filebeat::modules,
'overwrite_pipelines' => $filebeat::overwrite_pipelines,
'shutdown_timeout' => $filebeat::shutdown_timeout,
'registry' => {
'path' => $filebeat::registry_path,
'file_permissions' => $filebeat::registry_file_permissions,
'flush' => $filebeat::registry_flush,
Expand Down Expand Up @@ -69,12 +70,13 @@
'fields' => $filebeat::fields,
'fields_under_root' => $filebeat::fields_under_root,
'filebeat' => {
'spool_size' => $filebeat::spool_size,
'idle_timeout' => $filebeat::idle_timeout,
'registry_file' => $filebeat::registry_file,
'publish_async' => $filebeat::publish_async,
'config_dir' => $filebeat::config_dir,
'shutdown_timeout' => $filebeat::shutdown_timeout,
'config_dir' => $filebeat::config_dir,
'idle_timeout' => $filebeat::idle_timeout,
'overwrite_pipelines' => $filebeat::overwrite_pipelines,
'publish_async' => $filebeat::publish_async,
'registry_file' => $filebeat::registry_file,
'shutdown_timeout' => $filebeat::shutdown_timeout,
'spool_size' => $filebeat::spool_size,
},
'output' => $filebeat::outputs,
'shipper' => $filebeat::shipper,
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
# @param xpack [Hash] Configuration items to export internal stats to a monitoring Elasticsearch cluster
# @param extra_validate_options [String] Extra command line options to pass to the configuration validation command
# @param autodiscover [Hash] Will be converted to YAML for the optional autodiscover section of the configuration (see documentation, and above)
# @param overwrite_pipelines [Boolean] If set to true filebeat will overwrite (ingest) pipeline in Elasticsearch
class filebeat (
String $package_ensure = $filebeat::params::package_ensure,
Boolean $manage_package = $filebeat::params::manage_package,
Expand Down Expand Up @@ -113,6 +114,7 @@
Optional[String] $registry_path = $filebeat::params::registry_path,
Optional[String] $registry_file_permissions = $filebeat::params::registry_file_permissions,
Optional[String] $registry_flush = $filebeat::params::registry_flush,
Boolean $overwrite_pipelines = $filebeat::params::overwrite_pipelines,

) inherits filebeat::params {

Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
$autodiscover = {}
$run_options = {}
$modules = []
$overwrite_pipelines = false
$kernel_fail_message = "${::kernel} is not supported by filebeat."
$osfamily_fail_message = "${::osfamily} is not supported by filebeat."
$conf_template = "${module_name}/pure_hash.yml.erb"
Expand Down
1 change: 1 addition & 0 deletions templates/filebeat.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ filebeat.publish_async: <%= @filebeat_config['filebeat']['publish_async'] %>
filebeat.idle_timeout: <%= @filebeat_config['filebeat']['idle_timeout'] %>
<% end -%>
filebeat.config_dir: <%= @filebeat_config['filebeat']['config_dir'] %>
filebeat.overwrite_pipelines: <%= @filebeat_config['filebeat']['overwrite_pipelines'] %>
filebeat.shutdown_timeout: <%= @filebeat_config['filebeat']['shutdown_timeout'] %>
filebeat.registry.path: <%= @filebeat_config['filebeat']['registry']['path'] %>
filebeat.registry.file_permissions: <%= @filebeat_config['filebeat']['registry']['file_permissions'] %>
Expand Down

0 comments on commit 3bd2a73

Please sign in to comment.