Support configuration of custom fluentd outputs

In some scenarios it may be useful to configure custom fluentd outputs
to forward logs to a logging service other than elasticsearch.

This change supports configuration of fluentd outputs by placing
output configuration files in /etc/kolla/config/fluentd/output/*.conf.

Change-Id: I3c0b271d88dbb307ba3a23546e29c72e8baeca55
Implements: blueprint fluentd-custom-outputs
This commit is contained in:
Mark Goddard 2017-07-11 15:36:00 +01:00
parent 26c8137cac
commit fb4651461b
5 changed files with 43 additions and 10 deletions

View File

@ -17,6 +17,7 @@
- config_json.changed | bool
or fluentd_input.changed | bool
or fluentd_output.changed | bool
or fluentd_output_custom.changed | bool
or fluentd_format.changed | bool
or fluentd_filter.changed | bool
or fluentd_td_agent.changed | bool

View File

@ -53,6 +53,23 @@
notify:
- Restart fluentd container
- name: Find custom fluentd output config files
local_action:
module: find
path: "{{ node_custom_config }}/fluentd/output"
pattern: "*.conf"
run_once: True
register: find_custom_fluentd_outputs
- name: Copying over custom fluentd output config files
template:
src: "{{ item.path }}"
dest: "{{ node_config_directory }}/fluentd/output/{{ item.path | basename }}"
register: fluentd_output_custom
with_items: "{{ find_custom_fluentd_outputs.files }}"
notify:
- Restart fluentd container
- name: Copying over fluentd format config files
template:
src: "conf/format/{{ item }}.conf.j2"

View File

@ -70,17 +70,12 @@
"dest": "{{ fluentd_dir }}/format/wsgi_access.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},{% if enable_elasticsearch | bool or
( elasticsearch_address != kolla_internal_vip_address ) | bool %}
},
{# Copy all configuration files in output/ directory to include #}
{# custom output configs. #}
{
"source": "{{ container_config_directory }}/output/01-es.conf",
"dest": "{{ fluentd_dir }}/output/01-es.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},{% endif %}
{
"source": "{{ container_config_directory }}/output/00-local.conf",
"dest": "{{ fluentd_dir }}/output/00-local.conf",
"source": "{{ container_config_directory }}/output/*.conf",
"dest": "{{ fluentd_dir }}/output/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
}

View File

@ -154,3 +154,13 @@ item can be exported separately by selecting it in the menu. All of the items
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 forwarding
=====================
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.
Configuration of custom fluentd outputs is possible by placing output
configuration files in ``/etc/kolla/config/fluentd/output/*.conf`` on the
control host.

View File

@ -0,0 +1,10 @@
---
features:
- |
Adds ability to configure custom fluentd outputs.
In some scenarios it may be useful to configure custom fluentd outputs
to forward logs to a logging service other than elasticsearch.
Configuration of custom fluentd outputs is possible by placing
output configuration files in /etc/kolla/config/fluentd/output/\*.conf.