Showing with 26 additions and 12 deletions.
  1. +9 −1 CHANGELOG.md
  2. +2 −1 README.md
  3. +1 −0 manifests/config.pp
  4. +3 −1 manifests/init.pp
  5. +1 −1 manifests/input.pp
  6. +1 −0 manifests/params.pp
  7. +2 −2 metadata.json
  8. +2 −1 spec/classes/config_spec.rb
  9. +5 −5 templates/input.yml.erb
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ Changelog
=========

## Unreleased
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v4.7.1...HEAD)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v4.9.0...HEAD)

## [v4.9.0](https://github.com/pcfens/puppet-filebeat/tree/v4.9.0)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v4.8.0...v4.9.0)


- Make pipeline available in all inputs [\#275](https://github.com/pcfens/puppet-filebeat/pull/275)
- Support autodiscovery [\#278](https://github.com/pcfens/puppet-filebeat/pull/278)
- Support `close_timeout` as a string [\#279](https://github.com/pcfens/puppet-filebeat/pull/279)

## [v4.8.0](https://github.com/pcfens/puppet-filebeat/tree/v4.8.0)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v4.7.0...v4.8.0)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ Installs and configures filebeat.
- `cloud`: [Hash] Will be converted to YAML for the optional cloud.id and cloud.auth of the configuration (see documentation, and above)
- `outputs`: [Hash] Will be converted to YAML for the required outputs section of the configuration (see documentation, and above)
- `shipper`: [Hash] Will be converted to YAML to create the optional shipper section of the filebeat config (see documentation)
- `autodiscover`: [Hash] Will be converted to YAML for the optional autodiscover section of the configuration (see documentation, and above)`
- `logging`: [Hash] Will be converted to YAML to create the optional logging section of the filebeat config (see documentation)
- `systemd_beat_log_opts_override`: [String] Will overide the default `BEAT_LOG_OPTS=-e`. Required if using `logging` hash on systems running with systemd. required: Puppet 6.1+, Filebeat 7+,
- `modules`: [Array] Will be converted to YAML to create the optional modules section of the filebeat config (see documentation)
Expand All @@ -288,7 +289,7 @@ Installs and configures filebeat.
- `install_dir`: [String] Where filebeat should be installed (windows only)
- `tmp_dir`: [String] Where filebeat should be temporarily downloaded to so it can be installed (windows only)
- `shutdown_timeout`: [String] How long filebeat waits on shutdown for the publisher to finish sending events
- `beat_name`: [String] The name of the beat shipper (default: hostname)
- `beat_name`: [String] The name of the beat shipper (default: FQDN)
- `tags`: [Array] A list of tags that will be included with each published transaction
- `max_procs`: [Number] The maximum number of CPUs that can be simultaneously used
- `fields`: [Hash] Optional fields that should be added to each event output
Expand Down
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'output' => $filebeat::outputs,
'shipper' => $filebeat::shipper,
'logging' => $filebeat::logging,
'autodiscover' => $filebeat::autodiscover,
'runoptions' => $filebeat::run_options,
'processors' => $filebeat::processors,
'monitoring' => $filebeat::monitoring,
Expand Down
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# @param install_dir [String] Where filebeat should be installed (windows only)
# @param tmp_dir [String] Where filebeat should be temporarily downloaded to so it can be installed (windows only)
# @param shutdown_timeout [String] How long filebeat waits on shutdown for the publisher to finish sending events
# @param beat_name [String] The name of the beat shipper (default: hostname)
# @param beat_name [String] The name of the beat shipper (default: FQDN)
# @param tags [Array] A list of tags that will be included with each published transaction
# @param max_procs [Integer] The maximum number of CPUs that can be simultaneously used
# @param fields [Hash] Optional fields that should be added to each event output
Expand All @@ -50,6 +50,7 @@
# proxy_address [String] Proxy server to use for downloading files
# @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)
class filebeat (
String $package_ensure = $filebeat::params::package_ensure,
Boolean $manage_repo = $filebeat::params::manage_repo,
Expand Down Expand Up @@ -106,6 +107,7 @@
String $systemd_beat_log_opts_template = $filebeat::params::systemd_beat_log_opts_template,
String $systemd_override_dir = $filebeat::params::systemd_override_dir,
Optional[String] $extra_validate_options = undef,
Hash $autodiscover = $filebeat::params::autodiscover,

) inherits filebeat::params {

Expand Down
2 changes: 1 addition & 1 deletion manifests/input.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
Boolean $close_eof = false,
Variant[String, Integer] $clean_inactive = 0,
Boolean $clean_removed = true,
Integer $close_timeout = 0,
Variant[Integer,String] $close_timeout = 0,
Boolean $force_close_files = false,
Array[String] $include_lines = [],
Array[String] $exclude_lines = [],
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
$outputs = {}
$shipper = {}
$logging = {}
$autodiscover = {}
$run_options = {}
$modules = []
$kernel_fail_message = "${::kernel} is not supported by filebeat."
Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pcfens-filebeat",
"version": "4.8.0",
"version": "4.9.0",
"author": "pcfens",
"summary": "A module to install and manage the filebeat log shipper",
"license": "Apache-2.0",
Expand Down Expand Up @@ -100,7 +100,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.0.0 < 7.0.0"
"version_requirement": ">= 4.0.0 < 8.0.0"
}
],
"tags": [
Expand Down
3 changes: 2 additions & 1 deletion spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@
}
context 'with added extra_validate_options parameter' do
let(:pre_condition) { "class { 'filebeat': major_version => '#{major_version}', extra_validate_options => '--foo'}" }

it {
is_expected.to contain_file('filebeat.yml').with_validate_cmd(/filebeat --foo/)
is_expected.to contain_file('filebeat.yml').with_validate_cmd(%r{filebeat --foo})
}
end

Expand Down
10 changes: 5 additions & 5 deletions templates/input.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@
<%- if @force_close_files -%>
force_close_files: <%= @force_close_files %>
<%- end -%>
<%- if @pipeline -%>
pipeline: <%= @pipeline %>
<%- end -%>
<%- if @json.length > 0 -%>
### JSON configuration
Expand Down Expand Up @@ -189,8 +186,11 @@
close_timeout: <%= @close_timeout %>
<%- end -%>
<%- end -%>
<%- # Everything below this can be applied to any input. %>
<%- # https://www.elastic.co/guide/en/beats/filebeat/current/configuration-general-options.html#configuration-general %>
<%- # Everything below this can be applied to any input. -%>
<%- # https://www.elastic.co/guide/en/beats/filebeat/current/configuration-general-options.html#configuration-general -%>
<%- if @pipeline -%>
pipeline: <%= @pipeline %>
<%- end -%>
<%- if @fields.length > 0 -%>
fields:
<%- @fields.each_pair do |k, v| -%>
Expand Down