docs(skills): LogsQL clause-order and _time iron rules on the monit-query card - #154
Closed
ysyneu wants to merge 1 commit into
Closed
docs(skills): LogsQL clause-order and _time iron rules on the monit-query card#154ysyneu wants to merge 1 commit into
ysyneu wants to merge 1 commit into
Conversation
…uery card The monit-query card teaches `data --expr` by example for PromQL and Loki but names LogsQL only as a routing keyword, so a VictoriaLogs query gets written with SQL/PromQL/Loki habits and comes back 422 on syntax alone. Two dialect rules that differ from every other backend the card covers: - `stats` takes `by (...)` BEFORE the aggregate: `| stats by (level) count() n`. Trailing `by` — the SQL/PromQL/Loki form — is a parse error, so the retry that only changes the aggregate spelling fails identically. - `_time:` accepts a duration or a bracketed range (`_time:[<rfc3339>, <rfc3339>]`), never a slash range, and never an abbreviated date. Both are stated with the exact rejected forms and the error text they produce, plus a LogsQL worked example alongside the existing Loki one.
Contributor
Author
|
Closing — this card no longer reaches a reader.
The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
skills/flashduty/reference/monit-query.mdteachesmonit-query data --exprby example for PromQL and Loki, but LogsQL appears only as a routing keyword in "Route here when". A VictoriaLogs query therefore gets written with SQL/PromQL/Loki habits and is rejected by the datasource on syntax alone — and because the rejection is a parse error rather than a semantic one, retries that only reword the aggregate fail identically.What
Two gotcha bullets plus a LogsQL worked example:
statsputsby (...)before the aggregate —| stats by (level) count() n. The trailing-byforms (| stats count(*) by (level),| stats count() by level,| stats count(*) as n by level) all fail withcannot parse 'stats' pipe: unexpected token ... after [count(*)]. Multi-key and no-byglobal aggregate shapes are given too, along with the ordinary downstream pipes (sort,limit,filter)._time:takes a duration or a bracketed range —_time:1h,_time:[<rfc3339>, <rfc3339>]. Slash ranges and abbreviated dates fail withcannot parse duration at _time filter.Every accepted and rejected form in the text was executed against a live VictoriaLogs instance before being written down.
Verification
go build ./...cleango test ./...— all packages pass (incl.internal/skilldoc)