Nitesh B V
10/30/2025, 9:41 PMapiVersion: v1
data:
fluent-bit.conf: |
[SERVICE]
Flush 1
Daemon Off
Log_Level debug
Parsers_File /fluent-bit/etc/parsers.conf
HTTP_Server On
HTTP_Listen 0.0.0.0
HTTP_Port 2020
Storage.path /fluent-bit/logs
Storage.sync normal
Storage.checksum off
Storage.metrics on
Storage.backlog.mem_limit 128MB
Storage.max_chunks_up 2048
[INPUT]
Name tail
Path /var/log/containers/*.log
Tag kube.*
Parser cri
Parser_Fallback docker_json
Refresh_Interval 5
Buffer_Max_Size 64MB
Buffer_Chunk_Size 2MB
Mem_Buf_Limit 1GB
Skip_Long_Lines On
DB /var/log/flb_kube.db
DB.Sync full
Storage.type filesystem
[FILTER]
Name kubernetes
Match kube.*
Kube_URL <https://kubernetes.default.svc:443>
Kube_CA_File /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
Kube_Token_File /var/run/secrets/kubernetes.io/serviceaccount/token
Kube_Tag_Prefix kube.var.log.containers.
Merge_Log Off
Keep_Log On
Annotations Off
Labels On
[FILTER]
Name modify
Match *
Add project qa
Add cluster qa
[OUTPUT]
Name stdout
Match *
Format json_lines
[OUTPUT]
Name loki
Match kube.*
Host test.com
Port 443
Tenant_ID qa
tls On
tls.verify Off
Uri /loki/api/v1/push
Compress gzip
Workers 32
Retry_Limit 5
Labels job=fluent-bit,project=$project,cluster=$cluster,namespace=$kubernetes['namespace_name'],pod=$kubernetes['pod_name'],container=$kubernetes['container_name'],app=$kubernetes['labels']['app.kubernetes.io/name'],tier=$kubernetes['labels']['tier'],release=$kubernetes['labels']['release'],host=$kubernetes['host']
storage.total_limit_size 8G
Auto_Kubernetes_Labels On
net.keepalive On
net.connect_timeout 10s
net.keepalive_idle_timeout 30s
parsers.conf: |
# Docker JSON (fallback)
[PARSER]
Name docker_json
Format json
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%LZ
Time_Keep On
# CRI / containerd (primary)
[PARSER]
Name cri
Format regex
Regex ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<flags>[^ ]*) (?<log>.*)$
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L%z
Decode_Field_As escaped_utf8 log do_next
Decode_Field_As json logNitesh B V
10/30/2025, 9:43 PMNitesh B V
10/30/2025, 9:44 PMPat
10/31/2025, 12:57 PMNitesh B V
10/31/2025, 2:40 PMPat
10/31/2025, 2:42 PMNitesh B V
10/31/2025, 2:45 PM[warn] [input] {input name or alias} paused (mem buf overlimit)
[info] [input] {input name or alias} resume (mem buf overlimit)
later I configured to use disk fill / storage configuration since then I don't see any error on back pressure but writes to loki is bit slow so most of the logs are getting queued in storage.lecaros
11/05/2025, 8:57 PMNitesh B V
11/05/2025, 9:39 PMNitesh B V
11/05/2025, 9:39 PMlecaros
11/07/2025, 8:29 PMSujay
11/11/2025, 11:43 AMlecaros
11/11/2025, 11:44 AMSujay
11/11/2025, 11:45 AMlecaros
11/11/2025, 12:21 PM