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:
@@ -99,6 +99,12 @@ func (b *SearchRequestBuilder) Sort(order SortOrder, field string, unmappedType
|
||||
return b
|
||||
}
|
||||
|
||||
// AddTimeFieldWithStandardizedFormat adds a time field to fields with standardized time format
|
||||
func (b *SearchRequestBuilder) AddTimeFieldWithStandardizedFormat(timeField string) *SearchRequestBuilder {
|
||||
b.customProps["fields"] = []map[string]string{{"field": timeField, "format": "strict_date_optional_time_nanos"}}
|
||||
return b
|
||||
}
|
||||
|
||||
// AddDocValueField adds a doc value field to the search request
|
||||
func (b *SearchRequestBuilder) AddDocValueField(field string) *SearchRequestBuilder {
|
||||
b.customProps["docvalue_fields"] = []string{field}
|
||||
|
||||
Reference in New Issue
Block a user