Support configuration of custom fluentd filters

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 or to modify the tags to conform to a log format that
differs from the one defined by kolla-ansible.

Configuration of custom fluentd filters is possible by placing filter
configuration files in ``/etc/kolla/config/fluentd/filter/*.conf`` on
the ansible control host.

Change-Id: I29a20efb0df4bf3564ef009616c786e928aa26d9
Implements: blueprint fluentd-custom-filters
This commit is contained in:
Mark Goddard 2017-10-17 16:09:14 +01:00
parent baa9319a75
commit f12e72440a
5 changed files with 47 additions and 8 deletions

View File

@ -21,6 +21,7 @@
or fluentd_output_custom.changed | bool
or fluentd_format.changed | bool
or fluentd_filter.changed | bool
or fluentd_filter_custom.changed | bool
or fluentd_td_agent.changed | bool
or fluentd_container.changed | bool

View File

@ -117,6 +117,23 @@
notify:
- Restart fluentd container
- name: Find custom fluentd filter config files
local_action:
module: find
path: "{{ node_custom_config }}/fluentd/filter"
pattern: "*.conf"
run_once: True
register: find_custom_fluentd_filters
- name: Copying over custom fluentd filter config files
template:
src: "{{ item.path }}"
dest: "{{ node_config_directory }}/fluentd/filter/{{ item.path | basename }}"
register: fluentd_filter_custom
with_items: "{{ find_custom_fluentd_filters.files }}"
notify:
- Restart fluentd container
- name: Copying over td-agent.conf
template:
src: "td-agent.conf.j2"

View File

@ -47,15 +47,11 @@
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in filter/ directory to include #}
{# custom filter configs. #}
{
"source": "{{ container_config_directory }}/filter/00-record_transformer.conf",
"dest": "{{ fluentd_dir }}/filter/00-record_transformer.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/filter/01-rewrite.conf",
"dest": "{{ fluentd_dir }}/filter/01-rewrite.conf",
"source": "{{ container_config_directory }}/filter/*.conf",
"dest": "{{ fluentd_dir }}/filter/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},

View File

@ -155,6 +155,18 @@ can also be exported at once by choosing *export everything* option.
In the same tab (Settings - Objects) one can also import saved items by
choosing *import* option.
Custom log filtering
====================
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
or to modify the tags to conform to a log format that differs from the one
defined by kolla-ansible.
Configuration of custom fluentd filters is possible by placing filter
configuration files in ``/etc/kolla/config/fluentd/filter/*.conf`` on the
control host.
Custom log forwarding
=====================

View File

@ -0,0 +1,13 @@
---
features:
- |
Adds ability to configure custom fluentd filters.
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
or to modify the tags to conform to a log format that differs from the one
defined by kolla-ansible.
Configuration of custom fluentd filters is possible by placing filter
configuration files in ``/etc/kolla/config/fluentd/filter/*.conf`` on the
control host.