Allow custom fluentd input configurations

Co-authored-by: Mark Goddard <mark@stackhpc.com>
Change-Id: I2e5ecf5b01cc842ec480fc4d883a7d2283fc1c31
This commit is contained in:
Christian Berendt 2018-03-06 17:29:27 +01:00 committed by Doug Szumski
parent e7958d1435
commit 1b4430314c
5 changed files with 53 additions and 34 deletions

View File

@ -19,6 +19,7 @@
- service.enabled | bool - service.enabled | bool
- config_json.changed | bool - config_json.changed | bool
or fluentd_input.changed | bool or fluentd_input.changed | bool
or fluentd_input_custom.changed | bool
or fluentd_output.changed | bool or fluentd_output.changed | bool
or fluentd_output_custom.changed | bool or fluentd_output_custom.changed | bool
or fluentd_format.changed | bool or fluentd_format.changed | bool

View File

@ -58,6 +58,27 @@
notify: notify:
- Restart fluentd container - Restart fluentd container
- name: Find custom fluentd input config files
local_action:
module: find
path: "{{ node_custom_config }}/fluentd/input"
pattern: "*.conf"
run_once: True
register: find_custom_fluentd_inputs
when:
- enable_fluentd | bool
- name: Copying over custom fluentd input config files
template:
src: "{{ item.path }}"
dest: "{{ node_config_directory }}/fluentd/input/{{ item.path | basename }}"
register: fluentd_input_custom
when:
- enable_fluentd | bool
with_items: "{{ find_custom_fluentd_inputs.files }}"
notify:
- Restart fluentd container
- name: Copying over fluentd output config files - name: Copying over fluentd output config files
template: template:
src: "conf/output/{{ item.name }}.conf.j2" src: "conf/output/{{ item.name }}.conf.j2"

View File

@ -11,39 +11,11 @@
"owner": "{{ fluentd_user }}", "owner": "{{ fluentd_user }}",
"perm": "0600" "perm": "0600"
}, },
{# Copy all configuration files in input/ directory to include #}
{# custom input configs. #}
{ {
"source": "{{ container_config_directory }}/input/00-global.conf", "source": "{{ container_config_directory }}/input/*.conf",
"dest": "{{ fluentd_dir }}/input/00-global.conf", "dest": "{{ fluentd_dir }}/input/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/input/01-syslog.conf",
"dest": "{{ fluentd_dir }}/input/01-syslog.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/input/02-mariadb.conf",
"dest": "{{ fluentd_dir }}/input/02-mariadb.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/input/03-rabbitmq.conf",
"dest": "{{ fluentd_dir }}/input/03-rabbitmq.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/input/04-openstack-wsgi.conf",
"dest": "{{ fluentd_dir }}/input/04-openstack-wsgi.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/input/05-libvirt.conf",
"dest": "{{ fluentd_dir }}/input/05-libvirt.conf",
"owner": "{{ fluentd_user }}", "owner": "{{ fluentd_user }}",
"perm": "0600" "perm": "0600"
}, },

View File

@ -164,8 +164,16 @@ can also be exported at once by choosing *export everything* option.
In the same tab (Settings - Objects) one can also import saved items by In the same tab (Settings - Objects) one can also import saved items by
choosing *import* option. choosing *import* option.
Custom log rules
~~~~~~~~~~~~~~~~
Kolla-Ansible automatically deploys Fluentd for forwarding OpenStack logs
from across the control plane to a central logging repository. The Fluentd
configuration is split into four parts: Input, forwarding, filtering and
formatting. The following can be customised:
Custom log filtering Custom log filtering
==================== --------------------
In some scenarios it may be useful to apply custom filters to logs before In some scenarios it may be useful to apply custom filters to logs before
forwarding them. This may be useful to add additional tags to the messages forwarding them. This may be useful to add additional tags to the messages
@ -177,7 +185,7 @@ configuration files in ``/etc/kolla/config/fluentd/filter/*.conf`` on the
control host. control host.
Custom log forwarding Custom log forwarding
~~~~~~~~~~~~~~~~~~~~~ ---------------------
In some scenarios it may be useful to forward logs to a logging service other In some scenarios it may be useful to forward logs to a logging service other
than elasticsearch. This can be done by configuring custom fluentd outputs. than elasticsearch. This can be done by configuring custom fluentd outputs.
@ -185,3 +193,13 @@ than elasticsearch. This can be done by configuring custom fluentd outputs.
Configuration of custom fluentd outputs is possible by placing output Configuration of custom fluentd outputs is possible by placing output
configuration files in ``/etc/kolla/config/fluentd/output/*.conf`` on the configuration files in ``/etc/kolla/config/fluentd/output/*.conf`` on the
control host. control host.
Custom log inputs
-----------------
In some scenarios it may be useful to input logs from other services, e.g.
network equipment. This can be done by configuring custom fluentd inputs.
Configuration of custom fluentd inputs is possible by placing input
configuration files in ``/etc/kolla/config/fluentd/input/*.conf`` on the
control host.

View File

@ -0,0 +1,7 @@
---
features:
- |
Adds ability to configure custom fluentd inputs.
Configuration of custom fluentd inputs is possible by placing
input configuration files in /etc/kolla/config/fluentd/input/\*.conf.