Ansible role to install and configure fluentbit.
Building and improving this Ansible role have been sponsored by my current and previous employers like Cloudpunks GmbH and Proact Deutschland GmbH.
- Requirements
- Default Variables
- fluentbit_default_configs
- fluentbit_default_filters
- fluentbit_default_inputs
- fluentbit_default_outputs
- fluentbit_default_parsers
- fluentbit_extra_configs
- fluentbit_extra_filters
- fluentbit_extra_inputs
- fluentbit_extra_outputs
- fluentbit_extra_parsers
- fluentbit_group_configs
- fluentbit_group_filters
- fluentbit_group_inputs
- fluentbit_group_outputs
- fluentbit_group_parsers
- fluentbit_host_configs
- fluentbit_host_filters
- fluentbit_host_inputs
- fluentbit_host_outputs
- fluentbit_host_parsers
- fluentbit_keyring
- fluentbit_repo_distribution
- fluentbit_repo_release
- fluentbit_service_coro_stack_size
- fluentbit_service_flush
- fluentbit_service_http_listen
- fluentbit_service_http_port
- fluentbit_service_http_server
- fluentbit_service_log_level
- Discovered Tags
- Dependencies
- License
- Author
- Minimum Ansible version:
2.10
List of default configs
fluentbit_default_configs: []
fluentbit_default_configs:
- name: example
content: |
[INPUT]
Name cpu
Tag cpu.local
Interval_Sec 1
List of default filters
fluentbit_default_filters:
- name: host
content: |
Name modify
Match *
Add host {{ ansible_fqdn }}
fluentbit_default_filters:
- name: parser
content: |
Name parser
Match dummy.*
Key_Name data
Parser dummy_test
- name: to-remove
state: absent
List of default inputs
fluentbit_default_inputs:
- name: kern
content: |
Name Tail
Path /var/log/kern.log
Path_Key file
DB /var/lib/td-agent-bit/kern.db
Parser syslog
- name: auth
content: |
Name Tail
Path /var/log/auth.log
Path_Key file
DB /var/lib/td-agent-bit/auth.db
Parser syslog
- name: dpkg
content: |
Name tail
Path /var/log/dpkg.log
Path_Key file
DB /var/lib/td-agent-bit/dpkg.db
Parser dpkg
fluentbit_default_inputs:
- name: example
content: |
Name cpu
Tag cpu.local
Interval_Sec 1
- name: to-remove
state: absent
List of default outputs
fluentbit_default_outputs:
- name: stdout
content: |
Name stdout
Match *
fluentbit_default_outputs:
- name: stdout
content: |
Name stdout
Match *
- name: to-remove
state: absent
List of extra parsers, similar to fluentbit_default_parsers
fluentbit_default_parsers:
- name: apache2_access
format: regex
regex: |
^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>.*)")?$
time_key: time
time_format: '%d/%b/%Y:%H:%M:%S %z'
- name: apache2_error
format: regex
regex: |
^\[[^ ]* (?<time>[^\]]*)\] \[(?<level>[^\]]*)\](?: \[pid (?<pid>[^\]]*)\])?( \[client (?<client>[^\]]*)\])? (?<message>.*)$
time_key: time
time_format: '%b %d %H:%M:%S.%L %Y'
- name: json
format: json
time_key: time
time_format: '%d/%b/%Y:%H:%M:%S %z'
- name: docker
format: json
time_key: time
time_format: '%Y-%m-%dT%H:%M:%S.%L'
- name: dockerd
format: regex
regex: |
time="(?<time>[^ ]*)" level=(?<level>[^ ]*) msg="(?<msg>[^ ].*)"
time_key: time
time_format: '%Y-%m-%dT%H:%M:%S.%L'
- name: syslog
format: regex
regex: |
^(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$
time_key: time
time_format: '%b %d %H:%M:%S'
- name: mongodb
format: regex
regex: |
^(?<time>[^ ]*)\s+(?<severity>\w)\s+(?<component>[^ ]+)\s+\[(?<context>[^\]]+)]\s+(?<message>.*?)$
time_key: time
time_format: '%Y-%m-%dT%H:%M:%S.%L'
- name: mysql
format: regex
regex: |
^(?<time>\d{4}-\d{1,2}-\d{1,2}[ ]+\d{1,2}:\d{1,2}:\d{1,2}) (?<thread>[^ ]*) \[(?<level>[^ ]*)\] *(?<message>.*)$
time_key: time
time_format: '%Y-%m-%dT %H:%M:%S'
- name: dpkg
format: regex
regex: |
^(?<time>[^ ]+ [^ ]+) (?<message>.+)$
time_key: time
time_format: '%Y-%m-%d %H:%M:%S'
List of extra configs
fluentbit_extra_configs: []
List of extra filters, similar to fluentbit_default_filters
fluentbit_extra_filters: []
List of extra inputs, similar to fluentbit_default_inputs
fluentbit_extra_inputs: []
List of extra outputs, similar to fluentbit_default_configs
fluentbit_extra_outputs: []
fluentbit_extra_parsers: []
List of group configs
fluentbit_group_configs: []
List of group filters, similar to fluentbit_default_filters
fluentbit_group_filters: []
List of group inputs, similar to fluentbit_default_inputs
fluentbit_group_inputs: []
List of group outputs, similar to fluentbit_default_configs
fluentbit_group_outputs: []
fluentbit_group_parsers: []
List of host configs
fluentbit_host_configs: []
List of host filters, similar to fluentbit_default_filters
fluentbit_host_filters: []
List of host inputs, similar to fluentbit_default_inputs
fluentbit_host_inputs: []
List of host outputs, similar to fluentbit_default_configs
fluentbit_host_outputs: []
fluentbit_host_parsers: []
Path for the repository keyring
fluentbit_keyring: /usr/share/keyrings/fluentbit-archive-keyring.gpg
Enforce another distribution for the repo
fluentbit_repo_distribution: '{{ ansible_distribution | lower }}'
Enforce another release for the repo
fluentbit_repo_release: '{{ ansible_distribution_release }}'
Coroutines stack size in bytes
fluentbit_service_coro_stack_size: 24576
Interval of seconds to flush records
fluentbit_service_flush: 5
Listening address for the HTTP server
fluentbit_service_http_listen: 0.0.0.0
Listening port for the HTTP server
fluentbit_service_http_port: 2020
Enable the built-in HTTP server
fluentbit_service_http_server: false
Set the verbosity level of the service
fluentbit_service_log_level: info
fluentbit
- None
Apache-2.0