For the complete documentation index, see llms.txt. This page is also available as Markdown.

Custom logs collection

Custom k8s logs filtering / storing

By default, groundcover stores logs from all namespaces and workloads in your cluster. However there are multiple ways to modify this behavior.

Filtering Rules

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.

Rules are applied sequentially and independently. Therefore, rules which are meant to specify multiple values of the same label should be written as one rule with multiple options, and not many rules with one option each. For example, a rule to drop logs from all namespaces except prod and dev should be written as: {namespace!="prod", namespace!="dev"}

Usage

values.yaml example

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 Helm

helm upgrade -i  \
    groundcover \
    groundcover/groundcover \
    -n groundcover \
    -i \
    -f values.yaml

If upgrading an existing installation with different values, consider passing --reuse-values.

Configure Journal Logs

groundcover collects kubelet logs on Kubernetes clusters and docker logs on host machines. You can customize this behavior through additional configuration options.

Usage

Configure Log File Targets

groundcover can collect logs from specific files on your host machine. You can define paths to monitor and add custom labels to the collected logs.

Usage

Customize logs decolorization

This feature enable removing ANSI color codes from logs' body.

Usage

Example

Will be stripped into:

Control logs truncation

Body VS Content:

During log parsing groundcover generates two attributes named content and body:

  1. body - contains the full log line

  2. content - contains the message field of structured logs (from msg/message attribute) or the full log line for unstructured logs

In the platform UI the attribute displayed is the content, while body is available in the DB.

Example:

Formatted log with message: {"time": "Jun 09 2023 15:28:14", "severity": "info", "msg": "Hello World"}

Unformatted log: [Jun 09 2023 15:28:14], Hello World

Truncation Config:

The following values contain the default truncation size for body and content respectively:

Last updated