From 1a3c4f1bbfeaf276127172f91f41881363a2ef61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Tue, 28 Dec 2021 14:15:58 +0000 Subject: [PATCH] fluentd: add modern parsing config To satisfy the needs of the modern parser plugin. Needed-By: https://review.opendev.org/c/openstack/kolla/+/823071 Co-Authored-By: Dr. Jens Harbott Change-Id: I2b748d0544c14bebefe8c62aa5aafaaa5371ce53 --- .../common/templates/conf/format/apache_access.conf.j2 | 7 +++++++ .../roles/common/templates/conf/format/wsgi_access.conf.j2 | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/ansible/roles/common/templates/conf/format/apache_access.conf.j2 b/ansible/roles/common/templates/conf/format/apache_access.conf.j2 index c693a37358..9109048707 100644 --- a/ansible/roles/common/templates/conf/format/apache_access.conf.j2 +++ b/ansible/roles/common/templates/conf/format/apache_access.conf.j2 @@ -7,4 +7,11 @@ time_key Timestamp time_format %d/%b/%Y:%H:%M:%S %z keep_time_key true + + @type grok + grok_pattern \[%{HTTPDATE:Timestamp}\] "(?:%{WORD:http_method} %{NOTSPACE:http_url}(?: HTTP/%{NUMBER:http_version})?|%{DATA:rawrequest})" %{NUMBER:http_status} (?:\d+|-) + time_key Timestamp + time_format %d/%b/%Y:%H:%M:%S %z + keep_time_key true + diff --git a/ansible/roles/common/templates/conf/format/wsgi_access.conf.j2 b/ansible/roles/common/templates/conf/format/wsgi_access.conf.j2 index 036d788c83..5dbe537c9f 100644 --- a/ansible/roles/common/templates/conf/format/wsgi_access.conf.j2 +++ b/ansible/roles/common/templates/conf/format/wsgi_access.conf.j2 @@ -7,4 +7,11 @@ time_key Timestamp time_format %d/%b/%Y:%H:%M:%S %z keep_time_key true + + @type grok + grok_pattern %{IPORHOST:clientip} %{HTTPDUSER:ident} %{USER:auth} \[%{HTTPDATE:Timestamp}\] "(?:%{WORD:http_method} %{NOTSPACE:http_url}(?: HTTP/%{NUMBER:http_version})?|%{DATA:rawrequest})" %{NUMBER:http_status} (?:%{NUMBER:http_bytes}|-) (?:%{NUMBER:http_response_time_us}|-) %{QS:referrer} %{QS:agent} + time_key Timestamp + time_format %d/%b/%Y:%H:%M:%S %z + keep_time_key true +