Elasticsearch: Change Content-Type header to 'application/x-ndjson' for bulk streams

fixes #6609
This commit is contained in:
Michael Friedrich 2019-03-20 10:13:38 +01:00
parent 9c163c3848
commit 27a41804fc
2 changed files with 7 additions and 1 deletions

View 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

View 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();