From 76482c9a681f71a6c3a2cef35e8235536333979e Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Date: Tue, 20 Nov 2018 14:24:25 +0100 Subject: [PATCH] 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 --- ansible/roles/common/tasks/config.yml | 2 ++ .../common/templates/conf/input/00-global.conf.j2 | 1 - .../templates/conf/input/08-opendaylight.conf.j2 | 11 +++++++++++ .../templates/cron-logrotate-opendaylight.conf.j2 | 3 +++ ansible/roles/common/templates/cron.json.j2 | 1 + ansible/roles/common/templates/fluentd.json.j2 | 6 ++++++ 6 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/common/templates/conf/input/08-opendaylight.conf.j2 create mode 100644 ansible/roles/common/templates/cron-logrotate-opendaylight.conf.j2 diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index 540d77746e..5a8eb174a7 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -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 }}" } diff --git a/ansible/roles/common/templates/conf/input/00-global.conf.j2 b/ansible/roles/common/templates/conf/input/00-global.conf.j2 index 2817de4cb7..e8b048d192 100644 --- a/ansible/roles/common/templates/conf/input/00-global.conf.j2 +++ b/ansible/roles/common/templates/conf/input/00-global.conf.j2 @@ -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 ), diff --git a/ansible/roles/common/templates/conf/input/08-opendaylight.conf.j2 b/ansible/roles/common/templates/conf/input/08-opendaylight.conf.j2 new file mode 100644 index 0000000000..a1c7744580 --- /dev/null +++ b/ansible/roles/common/templates/conf/input/08-opendaylight.conf.j2 @@ -0,0 +1,11 @@ +{% set fluentd_dir = 'td-agent' if kolla_base_distro in ['ubuntu', 'debian'] else 'fluentd' %} + + @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 /^(?