Showing with 33 additions and 18 deletions.
  1. +8 −1 CHANGELOG.md
  2. +4 −2 README.md
  3. +2 −2 manifests/init.pp
  4. +2 −0 manifests/input.pp
  5. +4 −4 metadata.json
  6. +2 −1 spec/default_module_facts.yml
  7. +1 −1 spec/defines/input_spec.rb
  8. +10 −7 templates/prospector.yml.erb
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ Changelog
=========

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

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

- Fix regression of processors type
- Add support for syslog inputs [#\232](https://github.com/pcfens/puppet-filebeat/pull/233)
- Upgrade PDK to 1.15.0

## [v4.1.2](https://github.com/pcfens/puppet-filebeat/tree/v4.1.2)
[Full Changelog](https://github.com/pcfens/puppet-filebeat/compare/v4.1.1...v4.1.2)
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,17 @@ to fully understand what these parameters do.

**Parameters for `filebeat::input`**
- `ensure`: The ensure parameter on the input configuration file. (default: present)
- `paths`: [Array] The paths, or blobs that should be handled by the input. (required only if input_type is not _docker_)
- `paths`: [Array] The paths, or blobs that should be handled by the input. (required if input_type is _log_)
- `containers_ids`: [Array] If input_type is _docker_, the list of Docker container ids to read the logs from. (default: '*')
- `containers_path`: [String] If input_type is _docker_, the path from where the logs should be read from. (default: /var/log/docker/containers)
- `containers_stream`: [String] If input_type is _docker_, read from the specified stream only. (default: all)
- `combine_partial`: [Boolean] If input_type is _docker_, enable partial messages joining. (default: false)
- `cri_parse_flags`: [Boolean] If input_type is _docker_, enable CRI flags parsing from the log file. (default: false)
- `syslog_protocol`: [Enum tcp,udp] Syslog protocol (default: udp)
- `syslog_host`: [String] Host to listen for syslog messages (default: localhost:5140)
- `exclude_files`: [Array] Files that match any regex in the list are excluded from filebeat (default: [])
- `encoding`: [String] The file encoding. (default: plain)
- `input_type`: [String] log, docker or stdin - where filebeat reads the log from (default:log)
- `input_type`: [String] where filebeat reads the log from (default:log)
- `fields`: [Hash] Optional fields to add information to the output (default: {})
- `fields_under_root`: [Boolean] Should the `fields` parameter fields be stored at the top level of indexed documents.
- `ignore_older`: [String] Files older than this field will be ignored by filebeat (default: ignore nothing)
Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# @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
# @param fields_under_root [Boolean] If set to true, custom fields are stored in the top level instead of under fields
# @param processors [Hash] Processors that will be added. Commonly used to create processors using hiera.
# @param processors [Array] Processors that will be added. Commonly used to create processors using hiera.
# @param inputs [Hash] Inputs that will be created. Commonly used to create inputs using hiera
# @param setup [Hash] setup that will be created. Commonly used to create setup using hiera
# @param inputs_merge [Boolean] Whether $inputs should merge all hiera sources, or use simple automatic parameter lookup
Expand Down Expand Up @@ -86,7 +86,7 @@
Hash $fields = $filebeat::params::fields,
Boolean $fields_under_root = $filebeat::params::fields_under_root,
Boolean $disable_config_test = $filebeat::params::disable_config_test,
Hash $processors = {},
Array $processors = [],
Hash $inputs = {},
Hash $setup = {},
Array $modules = [],
Expand Down
2 changes: 2 additions & 0 deletions manifests/input.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
String $containers_path = '/var/lib/docker/containers',
String $containers_stream = 'all',
Boolean $combine_partial = false,
Enum['tcp', 'udp'] $syslog_protocol = 'udp',
String $syslog_host = 'localhost:5140',
Boolean $cri_parse_flags = false,
String $encoding = 'plain',
String $input_type = 'log',
Expand Down
8 changes: 4 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pcfens-filebeat",
"version": "4.1.2",
"version": "4.2.0",
"author": "pcfens",
"summary": "A module to install and manage the filebeat log shipper",
"license": "Apache-2.0",
Expand Down Expand Up @@ -106,7 +106,7 @@
"elasticsearch",
"elastic"
],
"pdk-version": "1.14.1",
"template-url": "pdk-default#1.14.1",
"template-ref": "1.14.1-0-g0b5b39b"
"pdk-version": "1.15.0",
"template-url": "pdk-default#1.15.0",
"template-ref": "tags/1.15.0-0-g0bc522e"
}
3 changes: 2 additions & 1 deletion spec/default_module_facts.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
filebeat_version: undef
concat_basedir: "/tmp"
concat_basedir: "/tmp"
service_provider: systemd
2 changes: 1 addition & 1 deletion spec/defines/input_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}
end

if os_facts[:kernel] != 'windows'
if os_facts[:kernel] == 'Linux'
it { is_expected.to compile }

it {
Expand Down
17 changes: 10 additions & 7 deletions templates/prospector.yml.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
---
- type: <%= @input_type %>
<%- if @input_type != 'docker' -%>
paths:
<%- @paths.each do |log_path| -%>
- <%= log_path %>
<%- end -%>
<%- else -%>
<%- if @input_type == 'docker' -%>
containers:
ids:
<%- @containers_ids.each do |id| -%>
Expand All @@ -15,7 +10,14 @@
stream: <%= @containers_stream %>
combine_partial: <%= @combine_partial %>
cri.parse_flags: <%= @cri_parse_flags %>
<%- end %>
<%- elsif @input_type == 'syslog' -%>
protocol.<%= @syslog_protocol %>:
host: <%= @syslog_host %>
<%- else -%>
paths:
<%- @paths.each do |log_path| -%>
- <%= log_path %>
<%- end -%>
<%- if @encoding -%>
encoding: <%= @encoding %>
<%- end -%>
Expand Down Expand Up @@ -196,3 +198,4 @@
processors:
<%- %><%= @processors.to_yaml.lines.drop(1).join.gsub(/^/, ' ') -%>
<%- end -%>
<%- end %>