Elasticsearch: Implement processing of logs query results in backend (#63647)
* Elasticsearch: Add processing of logs query to backend * Add and fix tests * Add snapshot tests * Fix test in ES client * Small updates, remove redundant logic * Refactor setPreferredVisType to improve readability
This commit is contained in:
@@ -37,15 +37,22 @@ func (rt *queryDataTestRoundTripper) RoundTrip(req *http.Request) (*http.Respons
|
||||
}
|
||||
|
||||
// we setup a fake datasource-info
|
||||
func newFlowTestDsInfo(body []byte, statusCode int, reuestCallback func(req *http.Request) error) *es.DatasourceInfo {
|
||||
func newFlowTestDsInfo(body []byte, statusCode int, requestCallback func(req *http.Request) error) *es.DatasourceInfo {
|
||||
client := http.Client{
|
||||
Transport: &queryDataTestRoundTripper{body: body, statusCode: statusCode, requestCallback: reuestCallback},
|
||||
Transport: &queryDataTestRoundTripper{body: body, statusCode: statusCode, requestCallback: requestCallback},
|
||||
}
|
||||
|
||||
configuredFields := es.ConfiguredFields{
|
||||
TimeField: "testtime",
|
||||
LogMessageField: "line",
|
||||
LogLevelField: "lvl",
|
||||
}
|
||||
|
||||
return &es.DatasourceInfo{
|
||||
ESVersion: semver.MustParse("8.5.0"),
|
||||
Interval: "Daily",
|
||||
Database: "[testdb-]YYYY.MM.DD",
|
||||
TimeField: "testtime",
|
||||
ConfiguredFields: configuredFields,
|
||||
TimeInterval: "1s",
|
||||
URL: "http://localhost:9200",
|
||||
HTTPClient: &client,
|
||||
|
||||
Reference in New Issue
Block a user