This is re-write of original td-agent cookbook, which is seriously overenginered and fails in places, especially with second Ruby installed (via RVM,for example).
Cookbooks installs fluents and basic configuration file. Additional configuratuion provides means to install fluentd plugins and create configrations for input plugins (sources) and output ones (matches).
- init.d script relies on RVM being installed in
/usr/local/rvm
.
- node[:fluentd][:plugins] - Array. List of short names of the fluent plugins, i.e gem name withoug
- node[:fluentd][:configs][:source] - Array of Hashes for input plugin configration
- node[:fluentd][:configs][:match] - Array of Hashes for output plugin configuration
Just include fluentd
in your node's run_list
:
{
"name":"my_node",
"run_list": [
"recipe[fluentd]"
]
}
- Role file
name "logger"
description "Log server"
run_list("recipe[fluentd]")
override_attributes 'fluentd' => {
'plugins' => [ 's3' ],
'configs' => Chef::DataBag.load(:application)["logger"]
}
- Databag
{
"id" : "logger",
"source" : [
{
"type" : "tail",
"format" : "syslog",
"path": "/var/log/messages,
"pos_file": "/var/log/messages.pos,
"tag": "tail.syslog"
}
],
"match" : [
{
"match": "tail.syslog",
"type": "s3",
"aws_key_id": "SECRET",
"aws_sec_key": "BIGSECRET",
"s3_bucket": "logbucket",
"s3_endpoint": "",
"path": "syslog/",
"buffer_path": "/var/log/fluent/buf/s3.syslog",
"time_slice_format": "%Y/%m/%d/%H",
"flush_interval": "10m"
}
]
}
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write you change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License: MIT
October, 2013
Authors:
- Dmytro Kovalov, [email protected]