Add configurable parameter for ES reload_connections
reload_connections set to true breaks our logging to ES
with SSL enabled.
https://github.com/uken/fluent-plugin-elasticsearch#reload_connections
Related-Prod: PROD-37064
Change-Id: Ic311c7cd09afcad55b3f5d0408197cd5d598ad24
diff --git a/README.rst b/README.rst
index ecc04cd..d20c539 100644
--- a/README.rst
+++ b/README.rst
@@ -82,6 +82,7 @@
port: 9200
buffer:
flush_thread_count: 8
+ reload_connections: false
monitoring:
worker: '0-2'
filter:
diff --git a/fluentd/files/match/elasticsearch.conf b/fluentd/files/match/elasticsearch.conf
index a9f1411..7f552ac 100644
--- a/fluentd/files/match/elasticsearch.conf
+++ b/fluentd/files/match/elasticsearch.conf
@@ -2,10 +2,14 @@
host {{ values.host }}
port {{ values.get("port", 9200) }}
scheme {{ values.get("scheme", "http") }}
-{%- if values.get("scheme", "http") == "https" %}
+{%- if values.get("scheme") == "https" %}
ssl_verify true
ca_file /etc/ssl/certs/ca-certificates.crt
ssl_version TLSv1_2
+# should be false when SSL with haproxy used
+ reload_connections {{ values.get("reload_connections", false) | lower }}
+{%- elif values.get("scheme") == "http" %}
+ reload_connections {{ values.get("reload_connections", true) | lower }}
{%- endif %}
type_name {{ values.get("es_type_name", "message") }}
tag_key {{ values.get("tag_key", "Logger") }}