]> granicus.if.org Git - icinga2/commitdiff
Fix ES 5 support
authorJean Flach <jean-marcel.flach@icinga.com>
Wed, 11 Apr 2018 12:04:39 +0000 (14:04 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Tue, 17 Apr 2018 07:17:20 +0000 (09:17 +0200)
lib/perfdata/elasticsearchwriter.cpp

index 531224e080ca27d62e5f9dda1c3d6aad42b18c80..2e8ffa5159e4879f8d2ebe9387cad7e112e291df 100644 (file)
@@ -419,9 +419,9 @@ void ElasticsearchWriter::SendRequest(const String& body)
        path.emplace_back(GetIndex() + "-" + Utility::FormatDateTime("%Y.%m.%d", Utility::GetTime()));
 
        /* ES 6 removes multiple _type mappings: https://www.elastic.co/guide/en/elasticsearch/reference/6.x/removal-of-types.html
-        * Best practice is to statically define 'doc'.
+        * Best practice is to statically define 'doc', as ES 5.X does not allow types starting with '_'.
         */
-       path.emplace_back("_doc");
+       path.emplace_back("doc");
 
        /* Use the bulk message format. */
        path.emplace_back("_bulk");