-
-
Notifications
You must be signed in to change notification settings - Fork 69
LogQL Supported Queries
Lorenzo Mangani edited this page Sep 23, 2021
·
32 revisions
LogQL is Loki's PromQL-inspired query language. cLoki supports many query types and will continue to introduce more and more. To see Loki's capabilities (aka what cLoki will work to achieve) go to Grafana's LogQL Page
Current functionality is found below, 'missing' functionality is found in the Roadmap.
- |=: Log line contains string
- !=: Log line does not contain string
- |~: Log line contains a match to the regular expression
- !~: Log line does not contain a match to the regular expression
- rate(log-range): calculates the number of entries per second
- count_over_time(log-range): counts the entries for each log stream within the given range.
- bytes_rate(log-range): calculates the number of bytes per second for each stream.
- bytes_over_time(log-range): counts the amount of bytes used by each log stream for a given range.
- absent_over_time(log-range): returns an empty vector if the range vector passed to it has any elements and a 1-element vector with the value 1 if the range vector passed to it has no elements. (absent_over_time is useful for alerting on when no time series and logs stream exist for label combination for a certain amount of time.)
- sum(count_over_time({label=value}[range])) by (label)
- | json: support for JSON output is working