puppet-filebeat
puppet-filebeat copied to clipboard
processors as exported resources
I'd like to be able to add processors as exported resources, like you can with inputs. This would me to define filebeat in a base profile, and then add configuration from roles. For example:
To add inputs I can do this:
filebeat::input { 'rails-api-logs':
paths => [
'/blah/production.json.log'
],
doc_type => 'syslog-beat',
fields => {
type => 'rails',
app => 'api'
}
}
Is it possible to do the same with processors? The obvious doesn't work:
filebeat::processors { 'rails-api-processors':
params => {
"add_host_metadata" => "~",
"add_cloud_metadata" => "~",
"add_docker_metadata" => "~",
"add_kubernetes_metadata" => "~",
"decode_json_fields" => {
"fields" => ["message"],
"target" =>"\"\"",
"overwrite_keys" => "true"
},
"rename" => {
"fields" => [{"from" => "host", "to" => "server" }]
}
}
}
We don't have a defined resource for a processor yet, but I like the idea. I'll add it to the todo list, though if someone has time and wants to submit a PR before I get to it that's fine too.