A Chef cookbook for setting up Barito Agent on server nodes.
This cookbook automates the installation and configuration of Barito Agent, which collects logs from various sources and forwards them to your Barito logging infrastructure.
- Automated Agent Setup: Installs and configures td-agent (Fluentd)
- Flexible Log Sources: Support for file, systemd, and other log sources
- systemd Integration: Built-in support for systemd journal logs
- Configurable Output: Easy configuration for Barito endpoints
- Ubuntu 16.04+
- CentOS 7+
- RHEL 7+
- Chef 14.0+
Include the cookbook in your runlist:
include_recipe 'barito-agent-cookbook'Configure log sources in your node attributes:
default['barito-agent-cookbook']['sources'] = [
{
type: 'tail',
name: 'application-logs',
path: '/var/log/myapp/*.log',
format: 'json'
}
]Example configuration for collecting systemd journal logs:
default['barito-agent-cookbook']['sources'] = [
{
type: 'systemd',
name: 'barito-journalctl',
path: '/run/log/journal',
raw_options: ['matches'],
matches: [{'_SYSTEMD_UNIT': 'syslog.service'}],
read_from_head: true,
storage: {
'@type': 'local',
persistent: true,
path: '/etc/td-agent/barito-journalctl.pos'
},
entry: {
fields_strip_underscores: true,
fields_lowercase: true
}
}
]Configure Barito output:
default['barito-agent-cookbook']['output'] = {
type: 'barito_vm',
application_secret: 'your-app-secret',
produce_url: 'https://your-barito-router/produce'
}| Attribute | Description | Default |
|---|---|---|
['barito-agent-cookbook']['sources'] |
Array of log source configurations | [] |
['barito-agent-cookbook']['output'] |
Output configuration for Barito | {} |
['barito-agent-cookbook']['agent_user'] |
User to run td-agent as | 'td-agent' |
['barito-agent-cookbook']['agent_group'] |
Group for td-agent | 'td-agent' |
{
type: 'tail',
name: 'access-logs',
path: '/var/log/nginx/access.log',
format: 'nginx'
}{
type: 'systemd',
name: 'system-logs',
path: '/run/log/journal',
matches: [{'_SYSTEMD_UNIT': 'nginx.service'}]
}{
type: 'syslog',
name: 'syslog',
port: 5140,
bind: '0.0.0.0'
}- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Licensed under the Apache License, Version 2.0.