]> granicus.if.org Git - icinga2/commitdiff
Elasticsearch: Change Content-Type header to 'application/x-ndjson' for bulk streams 7035/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Wed, 20 Mar 2019 09:13:38 +0000 (10:13 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 20 Mar 2019 09:13:38 +0000 (10:13 +0100)
fixes #6609

doc/16-upgrading-icinga-2.md
lib/perfdata/elasticsearchwriter.cpp

index cbe6cf142119e7540878f3acd54a3fddec9e0253..aebbcf51cbbaa0082b81dbb6608df5d014a27085 100644 (file)
@@ -27,6 +27,7 @@ This affects the following features:
 * [OpenTsdb](09-object-types.md#objecttype-opentsdbwriter)
 * [Perfdata](09-object-types.md#objecttype-perfdatawriter) (for PNP)
 
+
 ### Package Dependencies <a id="upgrading-to-2-11-package-dependencies"></a>
 
 #### Removed: YAJL
index 976813aca56e874a36ad98f0ac9f55c77746c943..8b2aa8bdaad59d1238ffd98ae24dbb92884744f1 100644 (file)
@@ -456,7 +456,12 @@ void ElasticsearchWriter::SendRequest(const String& body)
 
        /* Specify required headers by Elasticsearch. */
        req.AddHeader("Accept", "application/json");
-       req.AddHeader("Content-Type", "application/json");
+
+       /* Use application/x-ndjson for bulk streams. While ES
+        * is able to handle application/json, the newline separator
+        * causes problems with Logstash (#6609).
+        */
+       req.AddHeader("Content-Type", "application/x-ndjson");
 
        /* Send authentication if configured. */
        String username = GetUsername();