From d88c6a7fc76e3fb1d071a6f9407325f7031807b2 Mon Sep 17 00:00:00 2001 From: Cyril Tovena Date: Wed, 1 Apr 2020 10:28:55 -0400 Subject: [PATCH] Add precision about the range notation for LogQL. Signed-off-by: Cyril Tovena --- docs/logql.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/logql.md b/docs/logql.md index 8c0c28db9c696..a7f4be4a2ce36 100644 --- a/docs/logql.md +++ b/docs/logql.md @@ -118,6 +118,14 @@ aggregation syntax, including filter expressions. This example gets the per-second rate of all non-timeout errors within the last ten seconds for the MySQL job. +It should be noted that the range notation `[5m]` can be placed at end of the log stream filter or right after the log stream matcher. For example those two syntaxes below are equivalent. + +```logql +rate({job="mysql"} |= "error" != "timeout" [5m]) + +rate({job="mysql"}[5m] |= "error" != "timeout") +``` + ### Aggregation operators Like [PromQL](https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators),