From dee9d22dcf4910f8b94612872846df695d268165 Mon Sep 17 00:00:00 2001
From: John Garbutt <john.garbutt@stackhpc.com>
Date: Thu, 3 Jun 2021 11:41:06 +0100
Subject: [PATCH] Add suppress_type_name to stop warnings with ES7

When using elasticsearch 7 with fluentd, you seem to get a lot
of warnings in the docker logs output that look like:

    [types removal] Specifying types in bulk requests is deprecated.

The docs suggest adding suppress_type_name to stop these warnings,
and that seems to work without affecting any functionality.

Further info here:
https://github.com/uken/fluent-plugin-elasticsearch/issues/785

Closes-Bug: #1930856
Change-Id: I45be67df3717f78d78bcdc7df69600ab8681922f
---
 ansible/roles/common/templates/conf/output/00-local.conf.j2  | 4 ++++
 ansible/roles/common/templates/conf/output/01-es.conf.j2     | 1 +
 .../notes/fix_supress_type_warning-59f87fe62f83bd12.yaml     | 5 +++++
 3 files changed, 10 insertions(+)
 create mode 100644 releasenotes/notes/fix_supress_type_warning-59f87fe62f83bd12.yaml

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 5ceed1e59e..3d76855f54 100644
--- a/ansible/roles/common/templates/conf/output/00-local.conf.j2
+++ b/ansible/roles/common/templates/conf/output/00-local.conf.j2
@@ -35,6 +35,7 @@
        reconnect_on_error true
        buffer_type file
        buffer_path /var/lib/fluentd/data/elasticsearch.buffer/{{ syslog_swift_facility }}.*
+       suppress_type_name true
   </store>
 {% elif enable_monasca | bool and monasca_ingest_control_plane_logs | bool %}
   <store>
@@ -97,6 +98,7 @@
        reconnect_on_error true
        buffer_type file
        buffer_path /var/lib/fluentd/data/elasticsearch.buffer/{{ syslog_haproxy_facility }}.*
+       suppress_type_name true
   </store>
 {% elif enable_monasca | bool and monasca_ingest_control_plane_logs | bool %}
   <store>
@@ -157,6 +159,7 @@
        reconnect_on_error true
        buffer_type file
        buffer_path /var/lib/fluentd/data/elasticsearch.buffer/{{ syslog_glance_tls_proxy_facility }}.*
+       suppress_type_name true
   </store>
 {% elif enable_monasca | bool and monasca_ingest_control_plane_logs | bool %}
   <store>
@@ -218,6 +221,7 @@
        reconnect_on_error true
        buffer_type file
        buffer_path /var/lib/fluentd/data/elasticsearch.buffer/{{ syslog_neutron_tls_proxy_facility }}.*
+       suppress_type_name true
   </store>
 {% elif enable_monasca | bool and monasca_ingest_control_plane_logs | bool %}
   <store>
diff --git a/ansible/roles/common/templates/conf/output/01-es.conf.j2 b/ansible/roles/common/templates/conf/output/01-es.conf.j2
index c586938668..956d30156b 100644
--- a/ansible/roles/common/templates/conf/output/01-es.conf.j2
+++ b/ansible/roles/common/templates/conf/output/01-es.conf.j2
@@ -25,5 +25,6 @@
        reconnect_on_error true
        buffer_type file
        buffer_path /var/lib/fluentd/data/elasticsearch.buffer/openstack.*
+       suppress_type_name true
     </store>
 </match>
diff --git a/releasenotes/notes/fix_supress_type_warning-59f87fe62f83bd12.yaml b/releasenotes/notes/fix_supress_type_warning-59f87fe62f83bd12.yaml
new file mode 100644
index 0000000000..5116c9a9f4
--- /dev/null
+++ b/releasenotes/notes/fix_supress_type_warning-59f87fe62f83bd12.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+  - |
+    Stops Fluentd warning message when posting to Elasticsearch 7 bulk
+    API.
-- 
GitLab