Metric queries | Grafana Labs
https://grafana.com/docs/loki/latest/logql/metric_queriesMetric queries | Grafana Labs › LogQL › Metric queries Metric queries Metric queries extend log queries by applying a function to log query results. This powerful feature creates metrics from logs. Metric queries can be used to calculate the rate of error messages or the top N log sources with the greatest quantity of logs over the last 3 hours.
Metric queries | Grafana Labs
grafana.com › docs › lokiThe functions: 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 ...
Template functions | Grafana Labs
grafana.com › loki › latestThis function converts the entire string to lowercase or uppercase. Signatures: ToLower(string) string; ToUpper(string) string; Examples: "{{.request_method | ToLower}}" "{{.request_method | ToUpper}}" `{{ToUpper "This is a string" | ToLower}}` Note: In Grafana Loki 2.1 you can also use respectively lower and upper shortcut, e.g {{.request_method | lower }}.
Add a query variable | Grafana Labs
grafana.com › variable-types › add-query-variableQuery expressions can contain references to other variables and in effect create linked variables. Grafana detects this and automatically refreshes a variable when one of its linked variables change. Query expressions Query expressions are different for each data source. For more information, refer to the documentation for your data source.