Documentation ¶
Overview ¶
Package ql implements support for parsing and running logsprays simple query expressions.
Query expressions set of label and value matches. The ql does not currently support matching of the message text itself, this will be corrected in future Either label or value can be given as a quoted string using ",', or ` quotes. Four match types are supported:
= : an exact match, or the single wild card "*" for any value != : any value not equal to the value ~ : A regular expression match, against the label value !~ : A negated regular expression match against the label value
Matches for the same label are or'd together. Matches for different labels are and'd together.
For example:
job=somejob : a single match for a single job "job"=somejob job="otherjob with long name" : match two specific jobsl job=somejob instance=myserver : logs for job on a specific instance job~things-.* : all jobs matching things job=billing customer=* : all billing logs with any customer label set job=billing customer~acme-.* : all billing logs with any acme- customer label set
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error provides details of a syntax error
type MatchFunc ¶ added in v0.2.0
MatchFunc describes a function that can be used to accept/reject messages. If headerOnly is passed, only the header message is matched against, and terms involving unmatched labels are ignored. headerOnly is used to filter files before filtering individual messages.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser stores the state for the ivy parser.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner holds the state of the scanner.
type Token ¶
type Token struct { Type Type // The type of this item. Line int // The line number on which this token appears Text string // The text of this item. }
Token represents a token or text string returned from the scanner.