Skip to content

Commit bf7a78e

Browse files
authored
Fluent-bit config updates (verily-src#341)
* Fluent-bit config updates Specify "DB" to store file offsets so fluent-bit doesn't send duplicated logs to output * mount fluent-bit db folder with rw permissions
1 parent 1d84897 commit bf7a78e

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

startupscript/butane/aws/fluent-bit.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
Parser docker
2727
Path /var/lib/docker/containers/*/*.log
2828
Path_key filepath
29+
DB /var/lib/fluent-bit/flb_docker.db
30+
Read_from_Head true
2931
Skip_Long_Lines On
3032
Mem_Buf_Limit 10MB
33+
Refresh_Interval 5
3134

3235
[OUTPUT]
3336
Name cloudwatch_logs

startupscript/butane/gcp/fluent-bit.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@
2626
Parser docker
2727
Path /var/lib/docker/containers/*/*.log
2828
Path_key filepath
29+
DB /var/lib/fluent-bit/flb_docker.db
30+
Read_from_Head true
2931
Skip_Long_Lines On
3032
Mem_Buf_Limit 10MB
31-
33+
Refresh_Interval 5
34+
3235
[OUTPUT]
3336
name stackdriver
3437
match vm-*

startupscript/butane/run-fluent-bit.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ readonly CLOUD="$1"
4343
# Configuration with defaults
4444
readonly FLUENT_BIT_IMAGE="${FLUENT_BIT_IMAGE:-cr.fluentbit.io/fluent/fluent-bit:2.0-debug}"
4545

46+
# Db directory to store file offsets
47+
mkdir -p /var/lib/fluent-bit
48+
4649
# Build Docker run command arguments
4750
DOCKER_ARGS=(
4851
--rm
@@ -51,6 +54,7 @@ DOCKER_ARGS=(
5154
-v /etc/fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf:ro
5255
-v /var/log/journal:/var/log/journal:ro
5356
-v /var/lib/docker/containers:/var/lib/docker/containers:ro
57+
-v /var/lib/fluent-bit:/var/lib/fluent-bit
5458
)
5559

5660
# Add cloud-specific configuration

0 commit comments

Comments
 (0)