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
(cherry picked from commit 6acf543b90
)
This commit is contained in:
parent
4bb5f588bc
commit
834e2ad855
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.
|
||||
firstToken := strings.ToLower(lex.rawToken)
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
|
@ -317,7 +317,7 @@ var pipeNames = func() map[string]struct{} {
|
|||
"replace",
|
||||
"replace_regexp",
|
||||
"sort", "order",
|
||||
"stats",
|
||||
"stats", "by",
|
||||
"stream_context",
|
||||
"top",
|
||||
"uniq",
|
||||
|
|
Loading…
Reference in a new issue