From 75177f3a8dc89f2f6eb85e6392d93b67c0b621ac Mon Sep 17 00:00:00 2001
From: Varac <varac@varac.net>
Date: Mon, 6 Dec 2021 16:38:27 +0100
Subject: [PATCH] Howto search older messages

---
 docs/logging.rst | 36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)

diff --git a/docs/logging.rst b/docs/logging.rst
index 8f4210d40..a929c49bb 100644
--- a/docs/logging.rst
+++ b/docs/logging.rst
@@ -49,6 +49,13 @@ In another terminal you can now use ``logcli`` to query ``loki`` like this:
 
 Please follow :ref:`logging:LogQL query examples` for more LogQL query examples.
 
+Search older messages (in this case the last week and limit the output to 2000
+lines):
+
+.. code:: bash
+
+    logcli query --since=168h --limit=2000 --forward '{app="helm-controller"}'
+
 LogQL query examples
 ~~~~~~~~~~~~~~~~~~~~
 
@@ -119,18 +126,6 @@ Filter out redundant ``helm-controller`` messages:
 
    '{app="helm-controller"} !~ `(unchanged|event=refreshed|method=Sync|component=checkpoint)`'
 
-Debug oauth2 single sign-on with zulip:
-
-.. code:: PromQL
-
-   {container_name=~"(hydra|zulip)"}
-
-Query kubernetes events processed by the ``eventrouter`` app containing
-``warning``:
-
-.. code:: PromQL
-
-   '{app="eventrouter"} |~ "warning"'
 
 Cert-manager
 ^^^^^^^^^^^^
@@ -155,6 +150,23 @@ Show only warnings and errors from ``hydra``:
 
    {container_name="hydra"} != "level=info"
 
+Debug oauth2 single sign-on with zulip:
+
+.. code:: PromQL
+
+   {container_name=~"(hydra|zulip)"}
+
+Etc
+^^^
+
+Query kubernetes events processed by the ``eventrouter`` app containing
+``warning``:
+
+.. code:: PromQL
+
+   '{app="eventrouter"} |~ "warning"'
+
+
 .. _kubectl logs: https://kubernetes.io/docs/concepts/cluster-administration/logging
 .. _Promtail: https://grafana.com/docs/loki/latest/clients/promtail/
 .. _Loki: https://grafana.com/oss/loki/
-- 
GitLab