Elasticsearch: Fix processing of logs with not-recognized time format (#67767)
* Elasticsearch: Fix parsing of invalid time * Fix lint * Add more test data to data.js * Add tests * Fix lint * Update pkg/tsdb/elasticsearch/client/search_request.go
This commit is contained in:
@@ -325,6 +325,9 @@ func processLogsQuery(q *Query, b *es.SearchRequestBuilder, from, to int64, defa
|
||||
b.Sort(sort, defaultTimeField, "boolean")
|
||||
b.Sort(sort, "_doc", "")
|
||||
b.AddDocValueField(defaultTimeField)
|
||||
// We need to add timeField as field with standardized time format to not receive
|
||||
// invalid formats that elasticsearch can parse, but our frontend can't (e.g. yyyy_MM_dd_HH_mm_ss)
|
||||
b.AddTimeFieldWithStandardizedFormat(defaultTimeField)
|
||||
b.Size(stringToIntWithDefaultValue(metric.Settings.Get("limit").MustString(), defaultSize))
|
||||
b.AddHighlight()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user