Individual LogQL parts (used in the parent class). You can also use them individually for separate needs.
{env="staging"} |= "req-xxx" | pattern `ok: <ok>` | ok = "true" | unpack
^^^ ^^^ ^^^ ^^^ ^^^
StreamSelector LineFilters ParserExpression LabelFilters ParserExpression
Initializes a new instance of the LogQL
class.
Available init
types are:
string
- Create an instance ofLogQL
with a lineContains (lineFilter
) operator.string[]
- Create an instance ofLogQL
with multiple lineContains (lineFilter
) operators.StreamSelector
- Create an instance ofLogQL
based on aStreamSelector
subclass.LineFilters
- Create an instance ofLogQL
based on aLineFilters
subclass.StreamSelector
- Create an instance ofLogQL
based on aLabelFilters
subclass.ParserExpression
- Create an instance ofLogQL
based on aParserExpression
subclass.
Properties of the class are:
streamSelector
- see StreamSelectorlineFilters
- see LineFilterslabelFilters
- see LabelFiltersparserExpression
- see ParserExpression
Add a lineContains (|=
) line filter.
Add a lineDoesNotContain (!=
) line filter.
Add a lineContainsRegexMatch (|~
)
Add a lineDoesNotContainRegexMatch (!~
) line filter.
Converts the LogQL instance into a LogQL query string. Returns a string representing the LogQL query.