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
This commit is contained in:
Eduardo Gonzalez 2018-11-20 14:24:25 +01:00
parent 52319dabfb
commit 76482c9a68
6 changed files with 23 additions and 1 deletions

View File

@ -54,6 +54,7 @@
- "05-libvirt"
- "06-zookeeper"
- "07-kafka"
- "08-opendaylight"
notify:
- Restart fluentd container
@ -257,6 +258,7 @@
- { name: "neutron", enabled: "{{ enable_neutron }}" }
- { name: "nova", enabled: "{{ enable_nova }}" }
- { name: "octavia", enabled: "{{ enable_octavia }}" }
- { name: "opendaylight", enabled: "{{ enable_opendaylight }}" }
- { name: "outward-rabbitmq", enabled: "{{ enable_outward_rabbitmq }}" }
- { name: "panko", enabled: "{{ enable_panko }}" }
- { name: "rabbitmq", enabled: "{{ enable_rabbitmq }}" }

View File

@ -27,7 +27,6 @@
( 'neutron', enable_neutron ),
( 'nova', enable_nova ),
( 'octavia', enable_octavia ),
( 'opendaylight', enable_opendaylight ),
( 'panko', enable_panko ),
( 'rally', enable_rally ),
( 'sahara', enable_sahara ),

View File

@ -0,0 +1,11 @@
{% set fluentd_dir = 'td-agent' if kolla_base_distro in ['ubuntu', 'debian'] else 'fluentd' %}
<source>
@type tail
path /var/log/kolla/opendaylight/karaf.log
pos_file /var/run/{{ fluentd_dir }}/opendaylight.pos
tag infra.opendaylight
format multiline
format_firstline /\d{4}-\d{2}-\d{2}/
format1 /^(?<time>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\,\d{3})\s+\|\s+(?<level>[^|\s]+)\s+\|\s+(?<thread>[^|]+)\s+\|\s+(?<class>[\d -}]+)\s+\|\s+(?<bundle>[^|]+)\s+\|\s+(?<msg>.*)/
time_format %Y-%m-%d %H:%M:%S,%L
</source>

View File

@ -0,0 +1,3 @@
"/var/log/kolla/opendaylight/*.log"
{
}

View File

@ -40,6 +40,7 @@
( 'neutron', enable_neutron ),
( 'nova', enable_nova ),
( 'octavia', enable_octavia ),
( 'opendaylight', enable_opendaylight ),
( 'outward-rabbitmq', enable_outward_rabbitmq ),
( 'panko', enable_panko ),
( 'rabbitmq', enable_rabbitmq ),

View File

@ -31,6 +31,12 @@
"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. #}
{