influxdb/query/influxql/spectests/raw_with_regex_condition.go

21 lines
596 B
Go

package spectests
func init() {
RegisterFixture(
NewFixture(
`SELECT value FROM db0..cpu WHERE host =~ /.*er01/`,
`package main
from(bucketID: "")
|> range(start: 1677-09-21T00:12:43.145224194Z, stop: 2262-04-11T23:47:16.854775806Z)
|> filter(fn: (r) => r._measurement == "cpu" and r._field == "value")
|> filter(fn: (r) => r["host"] =~ /.*er01/)
|> group(columns: ["_measurement", "_start", "_stop", "_field"], mode: "by")
|> keep(columns: ["_measurement", "_start", "_stop", "_field", "_time", "_value"])
|> rename(columns: {_value: "value"})
|> yield(name: "0")
`,
),
)
}