Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds containerd parsing example to the Fluent Bit page #250

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions content/docs/logging-infrastructure/fluentbit.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,35 @@ The following sections show you some examples on configuring Fluent Bit. For the

> Note: These examples use the traditional method that configures the Fluent Bit deployment using **spec.fluentbit** section of {{% xref "/docs/logging-infrastructure/logging.md" %}}.

## Containerd log fields

The following example defines a custom Fluent Bit parser that places the parsed containerd log messages into the `log` field instead of the `message` field to be backwards compatible with docker container runtimes.

```yaml
apiVersion: logging.banzaicloud.io/v1beta1
kind: FluentbitAgent
metadata:
name: containerd
spec:
inputTail:
Parser: cri-log-key
# Parser that populates `log` instead of `message` to enable the Kubernetes filter's Merge_Log feature to work
# Mind the indentation, otherwise Fluent Bit will parse the whole message into the `log` key
customParsers: |
[PARSER]
Name cri-log-key
Format regex
Regex ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>[^ ]*) (?<log>.*)$
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L%z
# Required key remap if one wants to rely on the existing auto-detected log key in the fluentd parser and concat filter otherwise should be omitted
filterModify:
- rules:
- Rename:
key: log
value: message
```

## Filters

### Kubernetes (filterKubernetes)
Expand Down
Loading