mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 15:16:42 +00:00
wip
This commit is contained in:
parent
7ee0a851a9
commit
bae5ff23f5
2 changed files with 3 additions and 2 deletions
|
@ -398,7 +398,7 @@ func ParseQuery(s string) (*Query, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if !lex.isEnd() {
|
if !lex.isEnd() {
|
||||||
return nil, fmt.Errorf("unexpected unparsed tail; context: [%s]; tail: [%s]", lex.context(), lex.s)
|
return nil, fmt.Errorf("unexpected unparsed tail after [%s]; context: [%s]; tail: [%s]", q, lex.context(), lex.s)
|
||||||
}
|
}
|
||||||
return q, nil
|
return q, nil
|
||||||
}
|
}
|
||||||
|
@ -582,7 +582,7 @@ func getCompoundFuncArg(lex *lexer) string {
|
||||||
rawArg := lex.rawToken
|
rawArg := lex.rawToken
|
||||||
lex.nextToken()
|
lex.nextToken()
|
||||||
suffix := ""
|
suffix := ""
|
||||||
for !lex.isSkippedSpace && !lex.isKeyword("*", ",", ")", "|", "") {
|
for !lex.isSkippedSpace && !lex.isKeyword("*", ",", "(", ")", "|", "") {
|
||||||
suffix += lex.rawToken
|
suffix += lex.rawToken
|
||||||
lex.nextToken()
|
lex.nextToken()
|
||||||
}
|
}
|
||||||
|
|
|
@ -713,6 +713,7 @@ func TestParseQuerySuccess(t *testing.T) {
|
||||||
f(`in(err|fields x)`, `in(err | fields x)`)
|
f(`in(err|fields x)`, `in(err | fields x)`)
|
||||||
f(`ip:in(foo and user:in(admin, moderator)|fields ip)`, `ip:in(foo user:in(admin,moderator) | fields ip)`)
|
f(`ip:in(foo and user:in(admin, moderator)|fields ip)`, `ip:in(foo user:in(admin,moderator) | fields ip)`)
|
||||||
f(`x:in(_time:5m y:in(*|fields z) | stats by (q) count() rows|fields q)`, `x:in(_time:5m y:in(* | fields z) | stats by (q) count(*) as rows | fields q)`)
|
f(`x:in(_time:5m y:in(*|fields z) | stats by (q) count() rows|fields q)`, `x:in(_time:5m y:in(* | fields z) | stats by (q) count(*) as rows | fields q)`)
|
||||||
|
f(`in(bar:in(1,2,3) | uniq (x)) | stats count() rows`, `in(bar:in(1,2,3) | uniq by (x)) | stats count(*) as rows`)
|
||||||
|
|
||||||
// ipv4_range filter
|
// ipv4_range filter
|
||||||
f(`ipv4_range(1.2.3.4, "5.6.7.8")`, `ipv4_range(1.2.3.4, 5.6.7.8)`)
|
f(`ipv4_range(1.2.3.4, "5.6.7.8")`, `ipv4_range(1.2.3.4, 5.6.7.8)`)
|
||||||
|
|
Loading…
Reference in a new issue