Skip to main content

Module parser

Module parser 

Source
Expand description

§LogQL Parser

Recursive-descent parser over the crate::lexer token stream. Covers stream selectors and log pipelines (line filters, parser stages, label filters, formatters, unwrap); metric queries follow in a later phase of the epic.

Structs§

ParseError
Parse error with 1-based source position.

Enums§

Expr
A top-level LogQL expression: either a log query (returns log lines) or a metric query (returns numeric samples).

Functions§

parse
Parse a top-level LogQL expression, dispatching between a log query and a metric query. A query beginning with { is a log query; any other start (a range/vector function, a number, or a parenthesis) is a metric query.
parse_metric_query
Parse a metric query (rejects a bare log query).
parse_query
Parse a full log query: a stream selector followed by an optional pipeline. Metric-query wrappers are not parsed here.
parse_selector
Parse a bare stream selector, as sent by the metadata endpoints’ match[] parameter.