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

Occasional Corruption of JSON Logs when Uploading to S3 with Fluent Bit #8180

Closed
jayong-sv opened this issue Nov 15, 2023 · 3 comments
Closed
Labels
Stale status: waiting-for-triage unsupported version waiting-for-user Waiting for more information, tests or requested changes

Comments

@jayong-sv
Copy link

Bug Report

Describe the bug
I'm using Fluent Bit versions 1.8.1 and 1.9.10. There are some corrupted logs in S3 when uploading JSON logs. While it doesn't happen often, it seems to occur rarely, especially when the network conditions are not great. I'm currently trying to figure out whether Fluent Bit or network problems are causing this. Any help in resolving this would be much appreciated.

The corrupted logs have this kind of structure, and either the file can't be opened, or the JSON is messed up, causing parsing issues.
image (1)
image (2)
image (4)
image (3)

To Reproduce
conf file

[SERVICE]
    Flush         5.0
    Log_File      /home/ubuntu/our-log-dir/fluent-bit.log
    Log_Level     info
    Parsers_file  parsers.conf
    Daemon        off
    storage.path  /home/ubuntu/fluent-bit/storage/flb-storage/
    storage.sync  full
    storage.checksum on
    storage.backlog.mem_limit 200M

[INPUT]
    Name              tail
    Tag               our-log-name.history.s3
    Path              /home/vv-team/our-log-dir/our-log-name/history/history.log
    Mem_Buf_Limit     10MB
    Skip_Long_Lines   On
    Refresh_Interval  5.0
    storage.type      filesystem

[FILTER]
    Name parser
    Match *
    Key_name log
    Parser JSON_PARSE

[OUTPUT]
    Name    s3
    Match   *.s3
    region  ap-northeast-2
    bucket  our-log-dir
    store_dir   /home/ubuntu/fluent-bit/storage/s3
    total_file_size 10M
    storage.total_limit_size 30M
    upload_timeout  5m
    s3_key_format   /$TAG[0]/$TAG[1]/${INVENTORY_ID}/%Y-%m-%d/%Y%m%d%H%M%S_${INVENTORY_ID}_${HOSTNAME}_$TAG[1]_$UUID.json
    s3_key_format_tag_delimiters .
    Retry_Limit False


[OUTPUT]
    Name    s3
    Match   our-log-name.history.s3
    region  ap-northeast-2
    bucket  our-log-dir
    store_dir   /home/ubuntu/fluent-bit/storage/s3_log_name
    total_file_size 10M
    storage.total_limit_size 30M
    upload_timeout  5m
    s3_key_format   /our-log-name-history-v3/part_date=%Y-%m-%d/%Y%m%d%H%M%S_${INVENTORY_ID}_${HOSTNAME}_$TAG[1]_$UUID.json
    s3_key_format_tag_delimiters .
    Retry_Limit False

parser

[PARSER]
    Name        JSON_PARSE
    Format      json
    Time_Offset +0900

service

[Unit]
Description=TD Agent Bit
Requires=network.target
After=network.target

[Service]
Type=simple
ExecStart=/opt/td-agent-bit/bin/td-agent-bit -c /etc/td-agent-bit/td-agent-bit.conf
Restart=always

[Install]
WantedBy=multi-user.target

Your Environment

  • Version used: 1.8.1, 1.9.10
  • Environment name and version: plain pc
  • Operating System and version: ubuntu 20.04
@patrick-stephens
Copy link
Contributor

Neither 1.8 or 1.9 are supported so I would encourage you to step up to the latest 2.2.0 version to confirm if it is already resolved.

@patrick-stephens patrick-stephens added waiting-for-user Waiting for more information, tests or requested changes unsupported version labels Nov 15, 2023
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@github-actions github-actions bot added the Stale label Feb 15, 2024
Copy link
Contributor

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale status: waiting-for-triage unsupported version waiting-for-user Waiting for more information, tests or requested changes
Projects
None yet
Development

No branches or pull requests

2 participants