Hi Team, With the following Fluent Bit configurati...
# fluent-bit
d
Hi Team, With the following Fluent Bit configuration, I'm aiming to process approximately 600K events per minute. These events are distributed across 40 files in NFS directory, which are generated hourly. Additionally, some events may still be written to older files. To optimise performance, filesystem storage has been disabled. Issue Observed • Events that were already ingested in real-time are being re-ingested on an hourly basis. Impact • This results in duplicate events and delayed ingestion, affecting data accuracy and timeliness. Could you please review the configuration and let me know if there are any misconfigurations or improvements that can help prevent re-ingestion and ensure consistent performance?
Copy code
[SERVICE]
    Flush                       1
    Grace                       15
    Daemon                      Off
    HTTP_Server                 On
    HTTP_Listen                 0.0.0.0
    HTTP_Port                   2020
    Health_Check                On
    Storage.metrics             On
    Storage.sync                Normal
    Storage.checksum            Off
    Storage.path                /data/fluentbit/storage
    Storage.backlog.mem_limit   24576M
    Storage.backlog.chunk_size  1M
    Storage.max_chunks_up       128
    Storage.delete_oldest       On
    storage.delete_irrecoverable_chunks On
    storage.pause_on_chunks_overlimit On
    storage.backlog.flush_on_shutdown On
    Hot_Reload                  On
    Log_Level                   Info
    Log_File                    /mnt/prod/fluentbit/logs/log-2025-10-23.log
    Workers                     12

[INPUT]
    Name                        tail
    Path                        /logs/source/*.ndjson
    Path_Key                    filepath
    Tag                         daily.logs
    DB                          /data/fluentbit/db/fluentbit.db
    DB.Sync                     full
    DB.compare_filename         true
    DB.locking                  true
    Mem_Buf_Limit               24576M
    Buffer_Chunk_Size           1M
    Buffer_Max_Size             4M
    Skip_Long_Lines             On
    Skip_Empty_Lines            On
    Refresh_Interval            2
    Ignore_Older                24h
    Rotate_Wait                 86400
    Read_from_Head              true
    Inotify_Watcher             true
    Exit_On_Eof                 Off
    Multiline                   Off
    threaded                    true
    File_Cache_Advise           Off

[OUTPUT]
    Name                        http
    Match                       daily.logs
    Host                        clickhouse-chproxy.clickhouse-cluster.svc.cluster.local
    Port                        8080
    URI                         /?query=INSERT%20INTO%20events_distributed
    Format                      json
    json_date_key               timestamp
    json_date_format            iso8601
    Header                      Content-Type application/json
    Workers                     12
    Retry_Limit                 no_retries
    net.connect_timeout         20
    net.keepalive               On
    net.keepalive_idle_timeout  300
    net.keepalive_max_recycle   2000
    net.max_worker_connections  0
    storage.total_limit_size    8GB
    Compress                    gzip
cc: @Pat, @lecaros
p
You have read from head on so if things restart you'll reingest already handled logs
d
Hi @Pat thank you so much for prompt response! DB is configured, will this not handle? Pod is not restarted, please find attached screenshots.
p
You should not configure both
DB will automatically read from the start of the file when it is first picked up.
What's your actual backend and are there any failures?
I wonder if it is retrying a chunk of multiple events because one of them fails so then you get duplicates
Your metrics for the output will give you any error and retry accounts, along with your logs. You can also disable retries to see if that removes duplicates.
Ah no, you have no_retries set
My suspicion would still be something in the output causing the duplicates, I'm not sure how the insert URI works vs others. I know Open/Elasticsearch have different upsert approaches that affect whether you get merged or duplicates
Unrelated but you probably want
ignore_active_older_files
too to drop FDs: https://github.com/fluent/fluent-bit/issues/11033#issuecomment-3417419386
d
Could enabling worker threads be causing duplicate ingestion?
Hi @Pat, i this could be one of the reason
p
Do you mean path duplication? Yeah if you're matching the rotated file as well then it'll be ingested again
You can exclude the rotated files easily enough, normally you just want
.log
files and then the rotated ones end up with a separate suffix you can exclude or just not match in the first place.
d
Log files are not move to different location till 24 hours then we remove those files to different directory
p
I don't understand - do you rotate them or just leave them there? If you don't rotate them then that's fine, it won't read them again (if you turn read from head off)
d
just leave the file, no rotation