I set my S3 output as below:
[OUTPUT] Name s3 Match 3-year* bucket my-bucket-name region ap-northeast-1 upload_timeout 60m compression gzip store_dir /app/opt/fluentbit/buffer s3_key_format /$TAG[1]/$TAG[2]/%Y/%m/%d/$TAG[3]-$UUID.gz s3_key_format_tag_delimiters :
in S3, I finde the logs are not output as expected. for example, the logs from 0:00 to 9:00 of local time(JST) are stored in the previous day's folder. /2024/03/09 has logs of 2024/03/09 from 0:00 to 9:00 in local time. it seems S3 is using the UTC standard time to decide which folder to put the created log.
how can I put logs of 2024/03/09 from 0:00 to 9:00 in local time into /2024/03/09 folder? I tried the filter below but not work [FILTER] Name Lua Match * call append_tag code function append_tag(tag, timestamp, record) local_time = os.time() new_time = local_time + 96060 new_timestamp = os.date("!%Y-%m-%d-%TZ", new_time) new_record = record new_record["date"] = new_timestamp return 1, new_timestamp, new_record end