Manage Fluentd installation and configuration with Puppet using the td-agent.
- apt: "https://github.com/puppetlabs/puppetlabs-apt.git"
- concat: "https://github.com/puppetlabs/puppetlabs-concat.git"
- stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
No RedHat suport yet(THX to pranav )Automatic installation of td-agent Plugins(THX to darktim )- Ouput copy and roundrobin to multiple stores
Monitor/Restart Service(THX to darktim )- Logrotate td-agent logs
How to Configure a Agent to send Data to a centralised Fluentd-Server
include ::fluentd
fluentd::configfile { 'apache': }
fluentd::source { 'apache_main':
configfile => 'apache'
type => 'tail',
format => 'apache2',
tag => 'apache.access_log',
config => {
'path' => '/var/log/apache2/access.log',
'pos_file' => '/var/tmp/fluentd.pos',
}
}
fluentd::configfile { 'syslog': }
fluentd::source { 'syslog_main':
configfile => 'syslog',
type => 'tail',
format => 'syslog',
tag => 'system.syslog',
config => {
'path' => '/var/log/syslog',
'pos_file' => '/tmp/td-agent.syslog.pos',
}
}
fluentd::configfile { 'forward': }
fluentd::match { 'forward_main':
configfile => 'forward'
pattern => '**',
type => 'forward',
servers => [
{'host' => 'PUT_YOUR_HOST_HERE', 'port' => '24224'}
],
}
/etc/td-agent/
├── config.d
│ ├── collector.conf
│ ├── forward.conf
│ └── syslog.conf
├── ...
...
include ::fluentd
fluentd::configfile { 'forward': }
fluentd::source { 'forward_collector':
configfile => 'forward'
type => 'forward',
# config => {
# 'port' => '24224',
# 'bind' => '0.0.0.0',
# }
}
fluentd::match { 'forward_apache':
configfile => 'forward'
pattern => '**',
type => 'elasticsearch',
config => {
'logstash_format' => 'true',
}
}
/etc/td-agent/
├── config.d
│ └── forward.conf
├── ...
...