kolla-ansible/ansible/roles/common/templates/fluentd.json.j2
Eduardo Gonzalez 76482c9a68 Fix fluentd input log parser for OpenDaylight
OpenDaylight logs have different format than openstack,
is a karaf log with java error traces.
This PS add required config to make fluentd parse properly
ODL logs.

Change-Id: I34fb96c8a424679b3b618f2ff6a840b8dc165bec
2018-11-20 14:24:25 +01:00

83 lines
3.2 KiB
Django/Jinja

{% set fluentd_cmd = '/usr/sbin/td-agent' if kolla_base_distro in ['ubuntu', 'debian'] else '/usr/bin/fluentd -c /etc/fluentd/fluent.conf' %}
{% set fluentd_dir = '/etc/td-agent' if kolla_base_distro in ['ubuntu', 'debian'] else '/etc/fluentd' %}
{% set fluentd_conf = 'td-agent.conf' if kolla_base_distro in ['ubuntu', 'debian'] else 'fluent.conf' %}
{% set fluentd_user = 'td-agent' if kolla_base_distro in ['ubuntu', 'debian'] else 'fluentd' %}
{
"command": "{{ fluentd_cmd }}",
"config_files": [
{
"source": "{{ container_config_directory }}/td-agent.conf",
"dest": "{{ fluentd_dir }}/{{ fluentd_conf }}",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in input/ directory to include #}
{# custom input configs. #}
{
"source": "{{ container_config_directory }}/input/*.conf",
"dest": "{{ fluentd_dir }}/input/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/input/06-zookeeper.conf",
"dest": "{{ fluentd_dir }}/input/06-zookeeper.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/input/07-kafka.conf",
"dest": "{{ fluentd_dir }}/input/07-kafka.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/input/08-opendaylight.conf",
"dest": "{{ fluentd_dir }}/input/08-opendaylight.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in filter/ directory to include #}
{# custom filter configs. #}
{
"source": "{{ container_config_directory }}/filter/*.conf",
"dest": "{{ fluentd_dir }}/filter/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/format/apache_access.conf",
"dest": "{{ fluentd_dir }}/format/apache_access.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/format/wsgi_access.conf",
"dest": "{{ fluentd_dir }}/format/wsgi_access.conf",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in output/ directory to include #}
{# custom output configs. #}
{
"source": "{{ container_config_directory }}/output/*.conf",
"dest": "{{ fluentd_dir }}/output/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
}
],
"permissions": [
{
"path": "/var/log/kolla/haproxy",
"owner": "{{ fluentd_user }}:{{ fluentd_user }}",
"recurse": true
},
{
"path": "/var/log/kolla/swift",
"owner": "{{ fluentd_user }}:{{ fluentd_user }}",
"recurse": true
}
]
}