From 68d7814bcdd3ddd93dba0acd214e280992d14729 Mon Sep 17 00:00:00 2001 From: yurymuski Date: Mon, 16 Apr 2018 05:53:46 +0300 Subject: [PATCH] proccesors support on prospectors (#162) --- manifests/prospector.pp | 3 ++- templates/prospector.yml.erb | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/manifests/prospector.pp b/manifests/prospector.pp index f01d875..7828314 100644 --- a/manifests/prospector.pp +++ b/manifests/prospector.pp @@ -39,10 +39,11 @@ $tags = [], $symlinks = false, $pipeline = undef, + $processors = [], ) { validate_hash($fields, $multiline, $json) - validate_array($paths, $exclude_files, $include_lines, $exclude_lines, $tags) + validate_array($paths, $exclude_files, $include_lines, $exclude_lines, $tags, $processors) validate_bool($tail_files, $close_renamed, $close_removed, $close_eof, $clean_removed, $symlinks) $prospector_template = $filebeat::major_version ? { diff --git a/templates/prospector.yml.erb b/templates/prospector.yml.erb index 2272d15..fa3b4cc 100644 --- a/templates/prospector.yml.erb +++ b/templates/prospector.yml.erb @@ -177,3 +177,13 @@ <%- if @close_timeout -%> close_timeout: <%= @close_timeout %> <%- end -%> + <%- if @processors.length > 0 -%> + # Managing processors releated only for specified prospector + processors: + <%- @processors.each do |proc| -%> + - <%= proc.keys[0] %>: + <%- proc[proc.keys[0]].each do |k, v| -%> + <%= k %>: <%= v %> + <%- end -%> + <%- end -%> + <%- end -%>