Fix Elastic 6 support

fixes #5905
This commit is contained in:
Michael Friedrich 2018-02-08 18:00:00 +01:00
parent b76ef91908
commit 975ac47f8e
1 changed files with 3 additions and 1 deletions

View File

@ -357,7 +357,9 @@ void ElasticsearchWriter::Enqueue(const String& type, const Dictionary::Ptr& fie
* We do it this way to avoid problems with a near full queue.
*/
String indexBody = R"({ "index" : { "_type" : ")" + eventType + "\" } }\n";
/* ES 6 removes multiple _type mappings: https://www.elastic.co/guide/en/elasticsearch/reference/6.x/removal-of-types.html
* We still need to send an index header. Best practice is to statically define 'doc'. */
String indexBody = "{ \"index\" : { \"_type\": \"doc\" } }\n";
String fieldsBody = JsonEncode(fields);
Log(LogDebug, "ElasticsearchWriter")