mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/logstorage: disallow using by as the first word in log filters, since it frequently clashes with stats by(...)
pipe where stats
word is omitted
This commit is contained in:
parent
ad5d8097da
commit
6acf543b90
2 changed files with 2 additions and 2 deletions
|
@ -717,7 +717,7 @@ func ParseQueryAtTimestamp(s string, timestamp int64) (*Query, error) {
|
||||||
// Verify the first token doesn't match pipe names.
|
// Verify the first token doesn't match pipe names.
|
||||||
firstToken := strings.ToLower(lex.rawToken)
|
firstToken := strings.ToLower(lex.rawToken)
|
||||||
if _, ok := pipeNames[firstToken]; ok {
|
if _, ok := pipeNames[firstToken]; ok {
|
||||||
return nil, fmt.Errorf("the query [%s] cannot start with pipe - it must start with madatory filter; see https://docs.victoriametrics.com/victorialogs/logsql/#query-syntax; "+
|
return nil, fmt.Errorf("the query [%s] cannot start with pipe - it must start with mandatory filter; see https://docs.victoriametrics.com/victorialogs/logsql/#query-syntax; "+
|
||||||
"if the filter isn't missing, then please put the first word of the filter into quotes: %q", s, firstToken)
|
"if the filter isn't missing, then please put the first word of the filter into quotes: %q", s, firstToken)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -317,7 +317,7 @@ var pipeNames = func() map[string]struct{} {
|
||||||
"replace",
|
"replace",
|
||||||
"replace_regexp",
|
"replace_regexp",
|
||||||
"sort", "order",
|
"sort", "order",
|
||||||
"stats",
|
"stats", "by",
|
||||||
"stream_context",
|
"stream_context",
|
||||||
"top",
|
"top",
|
||||||
"uniq",
|
"uniq",
|
||||||
|
|
Loading…
Reference in a new issue