From 2ee13e179ffdac4ddc199e2d4d35ef8b18fcfb29 Mon Sep 17 00:00:00 2001 From: Doug Szumski Date: Thu, 23 May 2019 12:03:14 +0100 Subject: [PATCH] Set log message field name in Monasca Fluentd plugin Let the Monasca Fluentd output plugin handle mapping of the log message. Change-Id: I4a74a91b9b38d5c172397a7e7204e626bcedcfac Closes-Bug: #1830184 Depends-On: https://review.opendev.org/#/c/660988/ (cherry picked from commit a5cd622396700ff995d5fa7f70ff5bdeb2156013) --- .../conf/filter/00-record_transformer.conf.j2 | 14 -------------- .../common/templates/conf/output/00-local.conf.j2 | 2 ++ .../templates/conf/output/02-monasca.conf.j2 | 1 + 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/ansible/roles/common/templates/conf/filter/00-record_transformer.conf.j2 b/ansible/roles/common/templates/conf/filter/00-record_transformer.conf.j2 index a63fd5e73f..7f173dedfa 100644 --- a/ansible/roles/common/templates/conf/filter/00-record_transformer.conf.j2 +++ b/ansible/roles/common/templates/conf/filter/00-record_transformer.conf.j2 @@ -37,20 +37,6 @@ {% if enable_monasca | bool %} -# Kolla Fluentd input config configures Fluentd to save all log messages -# under the 'Payload' field, however the fluentd-monasca plugin assumes -# that log messages are saved under the 'message' field. Here we map the -# 'Payload' field to the 'message' field so that log can be forwarded to -# Monasca. - - @type record_transformer - enable_ruby true - - message ${record["Payload"]} - - remove_keys Payload - - # Kolla configures Fluentd to extract timestamps from OpenStack service # logs, however these timestamps are not saved in the event and are not # forwarded to Monasca. Here we save the timestamp which has been diff --git a/ansible/roles/common/templates/conf/output/00-local.conf.j2 b/ansible/roles/common/templates/conf/output/00-local.conf.j2 index 1837b0c5ce..84389dff37 100644 --- a/ansible/roles/common/templates/conf/output/00-local.conf.j2 +++ b/ansible/roles/common/templates/conf/output/00-local.conf.j2 @@ -27,6 +27,7 @@ password {{ monasca_agent_password }} domain_id default project_name {{ monasca_control_plane_project }} + message_field_name Payload {% endif %} @@ -62,6 +63,7 @@ password {{ monasca_agent_password }} domain_id default project_name {{ monasca_control_plane_project }} + message_field_name Payload {% endif %} diff --git a/ansible/roles/common/templates/conf/output/02-monasca.conf.j2 b/ansible/roles/common/templates/conf/output/02-monasca.conf.j2 index f495249ec0..420e6cdad7 100644 --- a/ansible/roles/common/templates/conf/output/02-monasca.conf.j2 +++ b/ansible/roles/common/templates/conf/output/02-monasca.conf.j2 @@ -9,5 +9,6 @@ password {{ monasca_agent_password }} domain_id default project_name {{ monasca_control_plane_project }} + message_field_name Payload