From ab7bb56df6bafc3f5fad76d870853de0267f24af Mon Sep 17 00:00:00 2001 From: Juan Pablo Suazo Date: Mon, 21 Mar 2022 18:32:00 -0300 Subject: [PATCH] Adds FluentD configuration for OpenvSwitch log matching Adds a new configuration file that provides fluentd with an appropiate regex to match with OpenvSwitch logs in both default files. The regex is segmented with variable as to isolate the relevant parts of each log message. Closes-Bug: #1965815 Signed-off-by: Juan Pablo Suazo Change-Id: Ife83c50c048d517a5c8a5dee588f8f7846fcee00 --- ansible/roles/common/tasks/config.yml | 2 ++ .../conf/input/10-openvswitch.conf.j2 | 25 +++++++++++++++++++ .../notes/bug-1965815-37fc4f82bef7a47e.yaml | 5 ++++ 3 files changed, 32 insertions(+) create mode 100644 ansible/roles/common/templates/conf/input/10-openvswitch.conf.j2 create mode 100644 releasenotes/notes/bug-1965815-37fc4f82bef7a47e.yaml diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index cef1d4753a..c8b1594f59 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -104,6 +104,8 @@ enabled: "{{ enable_prometheus_fluentd_integration | bool }}" - name: "conf/input/09-monasca.conf.j2" enabled: true + - name: "conf/input/10-openvswitch.conf.j2" + enabled: true customised_input_files: "{{ find_custom_fluentd_inputs.files | map(attribute='path') | list }}" # Filters fluentd_filter_files: "{{ default_filter_files | customise_fluentd(customised_filter_files) }}" diff --git a/ansible/roles/common/templates/conf/input/10-openvswitch.conf.j2 b/ansible/roles/common/templates/conf/input/10-openvswitch.conf.j2 new file mode 100644 index 0000000000..41b640a651 --- /dev/null +++ b/ansible/roles/common/templates/conf/input/10-openvswitch.conf.j2 @@ -0,0 +1,25 @@ + + @type tail + path /var/log/kolla/openvswitch/ovs-vswitchd.log + pos_file /var/run/td-agent/openvswitch.pos + tag infra.openvswitch + format multiline + format_firstline /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}/ + format1 /^(?\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3})Z\|\d{5,}\|(?\S+)\|(?\S+)\|(?.*)/ + time_key Timestamp + time_format %FT%T.%L + enable_watch_timer false + + + + @type tail + path /var/log/kolla/openvswitch/ovsdb-server.log + pos_file /var/run/td-agent/openvswitchdb.pos + tag infra.openvswitchdb + format multiline + format_firstline /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}/ + format1 /^(?\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3})Z\|\d{5,}\|(?\S+)\|(?\S+)\|(?.*)/ + time_key Timestamp + time_format %FT%T.%L + enable_watch_timer false + diff --git a/releasenotes/notes/bug-1965815-37fc4f82bef7a47e.yaml b/releasenotes/notes/bug-1965815-37fc4f82bef7a47e.yaml new file mode 100644 index 0000000000..412471ac9c --- /dev/null +++ b/releasenotes/notes/bug-1965815-37fc4f82bef7a47e.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Adds Fluentd configurations to allow matching OpenvSwitch logs. + `LP#1965815 `__