mirror of https://github.com/Icinga/icinga2.git
Move _type into url
This commit is contained in:
parent
975ac47f8e
commit
fd5d4c5974
|
@ -353,13 +353,10 @@ void ElasticsearchWriter::Enqueue(const String& type, const Dictionary::Ptr& fie
|
||||||
String eventType = m_EventPrefix + type;
|
String eventType = m_EventPrefix + type;
|
||||||
fields->Set("type", eventType);
|
fields->Set("type", eventType);
|
||||||
|
|
||||||
/* Every payload needs a line describing the index above.
|
/* Every payload needs a line describing the index.
|
||||||
* We do it this way to avoid problems with a near full queue.
|
* We do it this way to avoid problems with a near full queue.
|
||||||
*/
|
*/
|
||||||
|
String indexBody = "{\"index\": {} }\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);
|
String fieldsBody = JsonEncode(fields);
|
||||||
|
|
||||||
Log(LogDebug, "ElasticsearchWriter")
|
Log(LogDebug, "ElasticsearchWriter")
|
||||||
|
@ -421,6 +418,11 @@ void ElasticsearchWriter::SendRequest(const String& body)
|
||||||
*/
|
*/
|
||||||
path.emplace_back(GetIndex() + "-" + Utility::FormatDateTime("%Y.%m.%d", Utility::GetTime()));
|
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'.
|
||||||
|
*/
|
||||||
|
path.emplace_back("_doc");
|
||||||
|
|
||||||
/* Use the bulk message format. */
|
/* Use the bulk message format. */
|
||||||
path.emplace_back("_bulk");
|
path.emplace_back("_bulk");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue