fluent_bit

wpnops.fluent-bit

Build Status Ansible Galaxy

An ansible role to install and configure fluent-bit.

Please refer to fluentbit's documentation for tool specific configuration.

Role Variables

Name Description Required Default
fluentbit_svc.flush_seconds Fluentbit service flush time in seconds yes 5
fluentbit_svc.daemon Boolean value to set if Fluent Bit should run as a Daemon (background) or not. yes false
fluentbit_svc.log_level Set the logging verbosity level. Allowed values are: error, warn, info, debug and trace. yes info
fluentbit_svc.log_file Absolute path for an optional log file. By default all logs are redirected to the standard error interface (stderr). no
fluentbit_svc.custom_parsers_file Path for a parsers configuration file no
fluentbit_svc.custom_plugins_file Path for a plugins configuration file no
fluentbit_svc.streams_file Path for the Stream Processor configuration file. no
fluentbit_filters Dictionary with fluentbit filters no
fluentbit_inputs Dictionary with fluentbit inputs no
fluentbit_outputs Dictionary with fluentbit outputs no
fluentbit_custom_parsers Dictionary with fluentbit custom written parsers no

IF NO INPUTS OR OUTPUTS ARE DEFINED FLUENTBIT WILL INITIALIZE WITH THE FOLLOWING LOGGING STRUCTURE

[INPUT]
  Name cpu
  Tag cpu_default

[OUTPUT]
  Name file
  Match cpu_default
  Path /dev/null

EXAMPLE DICTIONARY BASED CONFIGURATION

fluentbit_inputs:
  - name: cpu
    tag: cpu_default

fluentbit_outputs:
  - name: file
    match: cpu_default
    path: /dev/null

IN CASE IT IS REQUIRED TO HAVE TOW KEYS WITH THE SAME NAME IN A CONFIGURATION DICTIONARY IT CAN BE SPECIFIED USING THE FOLLOWING FORMAT
For example:

fluentbit_filters:
  - name: record_modifier
    match: '*'
    0__record: hostname ${HOSTNAME}
    1__record: product something

Will result in:

[FILTER]
  name record_modifier
  match *
  record hostname ${HOSTNAME}
  record product something

Dependencies

By default this role does not depend on any external roles. If any such dependency is required please add them according to the documentation

Example Playbook

  • hosts: servers roles:
    • role: wpninfra.fluent-bit

Testing

Please make sure your environment has docker installed in order to run role validation tests. Additional python dependencies are listed in the requirements file

Role is tested against the following distributions (docker images):

  • Ubuntu Bionic
  • Ubuntu Focal
  • Centos 7
  • Centos 8
  • Rocky Linux 8
  • AmazonLinux 2

You can test the role directly from sources using command molecule test

License

This project is licensed under the terms of the MIT License

About

An Ansible role to install and configure fluent-bit

Install
ansible-galaxy install soloradish/ansible-role-fluent-bit
GitHub repository
License
mit
Downloads
22
Owner