Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geerlingguy/ansible-role-fluentd
Ansible role - Fluentd (td-agent)
https://github.com/geerlingguy/ansible-role-fluentd
ansible ansible-role containers efk fluentd logging monitoring
Last synced: about 1 month ago
JSON representation
Ansible role - Fluentd (td-agent)
- Host: GitHub
- URL: https://github.com/geerlingguy/ansible-role-fluentd
- Owner: geerlingguy
- License: mit
- Archived: true
- Created: 2020-03-19T16:41:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-10T22:47:52.000Z (over 1 year ago)
- Last Synced: 2024-08-02T15:53:56.041Z (4 months ago)
- Topics: ansible, ansible-role, containers, efk, fluentd, logging, monitoring
- Language: Jinja
- Homepage: https://galaxy.ansible.com/geerlingguy/fluentd
- Size: 20.5 KB
- Stars: 34
- Watchers: 3
- Forks: 29
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - geerlingguy/ansible-role-fluentd - Ansible role - Fluentd (td-agent) (Jinja)
README
# Ansible Role: Fluentd
[![CI](https://github.com/geerlingguy/ansible-role-fluentd/workflows/CI/badge.svg?event=push)](https://github.com/geerlingguy/ansible-role-fluentd/actions?query=workflow%3ACI)
An Ansible Role that installs Fluentd on RedHat/CentOS or Debian/Ubuntu. This role installs `td-agent`, which is a standalone version that doesn't require Ruby to be installed on the system separately. See [differences between td-agent and Fluentd here](https://www.fluentd.org/faqs).
## Requirements
N/A
## Role Variables
Available variables are listed below, along with default values (see `defaults/main.yml`):
fluentd_version: 3
The `td-agent` version to install. See more details about the [differences between v2, v3, and v4](https://docs.fluentd.org/quickstart/td-agent-v2-vs-v3-vs-v4).
fluentd_package_state: present
The `td-agent` Fluentd package state; set to `latest` to upgrade or change versions.
fluentd_service_name: td-agent
fluentd_service_state: started
fluentd_service_enabled: trueControls the Fluentd service options.
fluentd_plugins:
- fluent-plugin-elasticsearch# Alternative format:
fluentd_plugins:
- name: fluent-plugin-elasticsearch
version: '4.0.6'
state: presentA list of Fluentd plugins to install.
fluentd_conf_sources: |
[see defaults/main.yml for default content]fluentd_conf_filters: |
[see defaults/main.yml for default content]fluentd_conf_matches: |
[see defaults/main.yml for default content]The configuration which will be placed into the `td-agent.conf` file which controls how Fluentd listens for, filters, and routes log data. The defaults set up some basic options which can direct data to Treasure Data, but you should override these values with what's appropriate for your logs.
For example, if you want to monitor an Apache HTTP server's access log, you would add a source:
fluentd_conf_sources: |
@type tail
@id input_tail
@type apache2
path /var/log/httpd-access.log
tag apache.access
And then you could route `apache` log entries to Elasticsearch using:
fluentd_conf_matches: |
@type elasticsearch
host log.example.com
port 9200
user myuser
password mypassword
logstash_format true
Note that Elasticsearch would require the Fluentd plugin `fluent-plugin-elasticsearch` to be installed.
## Dependencies
N/A
## Example Playbook
```yaml
- hosts: searchvars:
fluentd_conf_sources: |
@type tail
@id input_tail
@type apache2
path /var/log/httpd-access.log
tag apache.access
roles:
- geerlingguy.fluentd
```## License
MIT / BSD
## Author Information
This role was created in 2020 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).