Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Processors #71

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class{"filebeat":
processors => [
{
"name" => "drop_fields",
"params" => ["input_type", "offset"]
"params" => {"fields" => ["input_type", "offset"]}
},
],
}
Expand All @@ -184,7 +184,7 @@ class{"filebeat":
processors => [
{
"name" => "drop_fields",
"params" => ["input_type", "offset"]
"params" => {"fields" => ["input_type", "offset"]}
},
{
"name" => "drop_event",
Expand Down Expand Up @@ -328,6 +328,9 @@ to fully understand what these parameters do.
This module doesn't load the [elasticsearch index template](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-getting-started.html#filebeat-template) into elasticsearch (required when shipping
directly to elasticsearch).

Only filebeat versions after 1.0.0-rc1 are supported. 1.0.0-rc1 and older don't
support YAML like the ruby template can easily generate.

When installing on Windows, there's an expectation that `C:\Temp` already exists, or an alternative
location specified in the `tmp_dir` parameter exists and is writable by puppet. The temp directory
is used to store the downloaded installer only.
Expand Down
10 changes: 5 additions & 5 deletions templates/filebeat5.yml.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<%-
def yaml_indent(conds, idx=4)
def yaml_indent(conds)
return_val = []
tmp_val = conds.to_yaml.split("\n")
tmp_val.delete('---')

tmp_val.each do |val|
return_val << " " + val
return_val << " " + val
end

return_val.join("\n")
Expand Down Expand Up @@ -79,13 +79,13 @@ max_procs: <%= @filebeat_config['max_procs'] %>
<%- unless @filebeat_config['processors'].empty? -%>
processors:
<%- @filebeat_config['processors'].each do |_proc| -%>
- <%= _proc['name'] %>:
- <%= _proc['name'] %>:
<%- unless _proc['when'].nil? or _proc['when'].empty? -%>
when:
when:
<%= yaml_indent(_proc['when']) %>
<%- end -%>
<%- _proc['params'].each do |key,val|-%>
<%= key %>: <%= val %>
<%= key %>: <%= val %>
<%- end -%>
<%- end -%>
<%- end -%>
Expand Down