From 90e13efd65b5164a0604e18ff65cb5459cd27a63 Mon Sep 17 00:00:00 2001
From: zhubingbing <zhu.bingbing@99cloud.net>
Date: Thu, 9 Feb 2017 05:41:41 +0000
Subject: [PATCH] Fix fluentd config error

Depends-On: 810fcdd28669bbd317c290d498d590ddb2c32f65
Change-Id: I88eff57448cc29ddff0f301f210623b2309e6b4d
Closes-Bug: #1663126
---
 .../roles/common/templates/conf/format/apache_access.conf.j2  | 4 +---
 .../roles/common/templates/conf/format/wsgi_access.conf.j2    | 4 +---
 .../roles/common/templates/conf/format/wsgi_python.conf.j2    | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)

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 631b0180c2..9a7276955e 100644
--- a/ansible/roles/common/templates/conf/format/apache_access.conf.j2
+++ b/ansible/roles/common/templates/conf/format/apache_access.conf.j2
@@ -1,14 +1,12 @@
 <filter apache_access>
   @type parser
   reserve_data true
+  format grok
   key_name message
-  <parse>
-  @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
-  </parse>
 </filter>
 
 <filter apache_access>
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 52ac0fab10..52367b24ce 100644
--- a/ansible/roles/common/templates/conf/format/wsgi_access.conf.j2
+++ b/ansible/roles/common/templates/conf/format/wsgi_access.conf.j2
@@ -1,12 +1,10 @@
 <filter wsgi_access>
   @type parser
   reserve_data true
+  format grok
   key_name message
-  <parse>
-  @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
-  </parse>
 </filter>
diff --git a/ansible/roles/common/templates/conf/format/wsgi_python.conf.j2 b/ansible/roles/common/templates/conf/format/wsgi_python.conf.j2
index 4f215f22ec..ff7435557e 100644
--- a/ansible/roles/common/templates/conf/format/wsgi_python.conf.j2
+++ b/ansible/roles/common/templates/conf/format/wsgi_python.conf.j2
@@ -1,12 +1,10 @@
 <filter openstack_python>
   @type parser
   reserve_data true
+  format grok
   key_name message
-  <parse>
-  @type "grok"
   grok_pattern %{TIMESTAMP_ISO8601:Timestamp} %{NUMBER:Pid} %{LOGLEVEL:severity_label} %{NOTSPACE:python_module} \[req-(?:%{NOTSPACE:request_id}) (?:%{NOTSPACE:user_id}) (?:%{NOTSPACE:tenant_id}) .*\] %{GREEDYDATA:Payload}
   time_format "%Y-%m-%d %H:%M:%S.%L"
   time_key Timestamp
   keep_time_key true
-  </parse>
 </filter>