Skip to content

Commit 074ed33

Browse files
committed
chore: add docs on using fba k8s multi line parser
Signed-off-by: Bence Csati <bence.csati@axoflow.com>
1 parent 7935e02 commit 074ed33

File tree

2 files changed

+60
-3
lines changed

2 files changed

+60
-3
lines changed

docs/configuration/crds/v1beta1/fluentbit_types.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,37 @@ Default: On
649649

650650
### K8S-Logging.Parser (string, optional) {#filterkubernetes-k8s-logging.parser}
651651

652-
Allow Kubernetes Pods to suggest a pre-defined Parser (read more about it in Kubernetes Annotations section)
652+
/*
653+
Allow Kubernetes Pods to suggest a pre-defined Parser through annotations.
654+
(Read more about it in the Kubernetes Annotations section.)
655+
656+
Default: Off
657+
658+
Important: When enabling this setting, you must also configure
659+
`inputTail.multiline.parser` with appropriate parsers (typically including `cri` for
660+
Container Runtime Interface logs). Without this configuration, the annotation-based
661+
parsing will not work correctly.
662+
663+
### Example Configuration
664+
665+
```yaml
666+
apiVersion: logging.banzaicloud.io/v1beta1
667+
kind: FluentbitAgent
668+
metadata:
669+
name: example-fluentbit
670+
spec:
671+
inputTail:
672+
multiline.parser: [cri] # Required when K8S-Logging.Parser is enabled
673+
filterKubernetes:
674+
K8S-Logging.Parser: "On"
675+
Merge_Log_Key: "parsed" # Optional but recommended to prevent key conflicts
676+
677+
# Once configured, you can use annotations on your pods:
678+
annotations:
679+
fluentbit.io/parser: "my-custom-parser"
680+
```
681+
*/
653682

654-
Default: Off
655683

656684
### Keep_Log (string, optional) {#filterkubernetes-keep_log}
657685

pkg/sdk/logging/api/v1beta1/fluentbit_types.go

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,36 @@ type FilterKubernetes struct {
343343
CacheUseDockerId string `json:"Cache_Use_Docker_Id,omitempty"`
344344
// Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id. The parser must be registered in a parsers file (refer to parser filter-kube-test as an example).
345345
RegexParser string `json:"Regex_Parser,omitempty"`
346-
// Allow Kubernetes Pods to suggest a pre-defined Parser (read more about it in Kubernetes Annotations section) (default:Off)
346+
/*
347+
Allow Kubernetes Pods to suggest a pre-defined Parser through annotations.
348+
(Read more about it in the Kubernetes Annotations section.)
349+
350+
Default: Off
351+
352+
Important: When enabling this setting, you must also configure
353+
`inputTail.multiline.parser` with appropriate parsers (typically including `cri` for
354+
Container Runtime Interface logs). Without this configuration, the annotation-based
355+
parsing will not work correctly.
356+
357+
### Example Configuration
358+
359+
```yaml
360+
apiVersion: logging.banzaicloud.io/v1beta1
361+
kind: FluentbitAgent
362+
metadata:
363+
name: example-fluentbit
364+
spec:
365+
inputTail:
366+
multiline.parser: [cri] # Required when K8S-Logging.Parser is enabled
367+
filterKubernetes:
368+
K8S-Logging.Parser: "On"
369+
Merge_Log_Key: "parsed" # Optional but recommended to prevent key conflicts
370+
371+
# Once configured, you can use annotations on your pods:
372+
annotations:
373+
fluentbit.io/parser: "my-custom-parser"
374+
```
375+
*/
347376
K8SLoggingParser string `json:"K8S-Logging.Parser,omitempty"`
348377
// Allow Kubernetes Pods to exclude their logs from the log processor (read more about it in Kubernetes Annotations section). (default:On)
349378
K8SLoggingExclude string `json:"K8S-Logging.Exclude,omitempty"`

0 commit comments

Comments
 (0)