Search
⌃K

Customize logs Collection

Custom k8s logs filtering / storing
By default, groundcover store logs from all namespaces and workloads in your cluster.
groundcover allows you to add logs filtering rules using LogQL syntax by creating a custom values.yaml file. The available labels to filter are: namespace, workload, pod, level, container. Example of filtering out all logs coming from namespace demo with level info: {namespace="demo",level="info"} In addition, we enable the use of the optional log stream pipeline in order filter the log lines. Example of filtering out all logs coming from container my-container which contain the word fifo or handler: {container="my-container"} |~ "fifo|handler"
More info on LogQL syntax can be found here.
Sometimes saving all the logs from your cluster can be heavy on storage and compute, so we've added the complementary storeIssuesLogsOnly flag can be set to indicate groundcover to collect logs only when issues are detected. Alternatively, this flag can also be enabled directly as a CLI flag (example below).

Usage

values.yaml example

storeIssuesLogsOnly: true
logsDropFilters:
- '{namespace="demo-ng",workload="loadgenerator"} |~ ".*GET.*"'
- '{namespace="demo-ng",workload="currencyservice"} !~ "received"'

Using CLI on New or Existing Installation

groundcover deploy --values values.yaml

Using CLI on New or Existing Installation with storeIssuesLogsOnly flag

groundcover deploy --values values.yaml --store-issues-logs-only

Using Helm on New Installation

more on getting api-key, see: Using Helm
helm upgrade \
groundcover \
groundcover/groundcover \
-n groundcover \
-i \
--set global.groundcover_token=<api-key>,clusterId=my_cluster
--values values.yaml

Using Helm on Existing Installation

helm upgrade \
groundcover \
groundcover/groundcover \
-n groundcover \
--reuse-values \
--values values.yaml