Skip to content

Commit

Permalink
common.go
Browse files Browse the repository at this point in the history
  • Loading branch information
yotamloe committed Jun 6, 2024
1 parent 0c463f3 commit ce271f0
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions tests/common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package tests

import (
"go.uber.org/zap"
"strings"
)

const (
BaseLogzioApiUrl = "https://api.logz.io/v1"
QueryTemplate = `{
"query": {
"query_string": {
"query": "{{QUERY}}"
}
},
"from": 0,
"size": 100,
"sort": [
{
"@timestamp": {
"order": "desc"
}
}
],
"_source": true,
"docvalue_fields": [
"@timestamp"
],
"version": true,
"stored_fields": [
"*"
],
"highlight": {},
"aggregations": {
"byType": {
"terms": {
"field": "type",
"size": 5
}
}
}
}`
)

func formatQuery(query string) string {
return strings.Replace(QueryTemplate, "{{QUERY}}", query, 1)
}

var (
logger, _ = zap.NewProduction()
)

0 comments on commit ce271f0

Please sign in to comment.