Skip to content

Instantly share code, notes, and snippets.

@ensean
Created July 6, 2023 02:14
Show Gist options
  • Save ensean/d52d39bf7eeb62c75f0988f9827fefa4 to your computer and use it in GitHub Desktop.
Save ensean/d52d39bf7eeb62c75f0988f9827fefa4 to your computer and use it in GitHub Desktop.
fluent-bit-cross-account-region-to-firehose
# 根据日志格式配置parser、filter
[INPUT]
name tail
Parser nginx
path /home/ec2-user/station/ev*log
db test.db
Mem_Buf_Limit 4096MB
[OUTPUT]
Name kinesis_firehose
Match *
region ap-southeast-1
stream PUT-OPS-bbsfs
Retry_Limit False
# 编辑文件 /lib/systemd/system/fluent-bit.service,添加AK、SK(需要能访问Firehose,如AmazonKinesisFirehoseFullAccess策略)
# 编辑完成后运行 sudo systemctl daemon-reload 更新配置
[Unit]
Description=Fluent Bit
Requires=network.target
After=network.target
[Service]
Environment="AWS_ACCESS_KEY_ID=AKxxxxxxxxxx"
Environment="AWS_SECRET_ACCESS_KEY=yn8Dyyyyyyyyyyyyy"
Type=simple
ExecStart=/opt/fluent-bit/bin/fluent-bit -c /opt/fluent-bit/etc/fluent-bit.conf
Type=simple
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment