Fluentd를 통한 일반 로그 전달
Fluentd를 사용하여 파일의 원시 로그를 S3로 전달
마지막 업데이트
도움이 되었나요?
도움이 되었나요?
td-agent-gem install fluent-plugin-kinesis<source>
@type tail
태그 syslog
path /path/to/file/*.log
pos_file /var/log/td-agent/pos_file.pos
<parse>
@type none
</parse>
</source>
<match syslog.**>
@type kinesis_firehose
region <FIREHOSE-REGION>
delivery_stream_name <FIREHOSE-NAME>
<assume_role_credentials>
duration_seconds 3600
role_arn <FIREHOSE-ROLE-ARN>
role_session_name "#{Socket.gethostname}-panther-audit"
</assume_role_credentials>
<format>
@type single_value
</format>
</match><source>
@type tail
태그 syslog
path /path/to/file/*.log
pos_file /var/log/td-agent/pos_file.pos
<parse>
@type none
</parse>
</source>
<match syslog.**>
@type s3
aws_key_id <ACCESS-KEY-ID>
aws_sec_key <SECRET-KEY>
s3_bucket <BUCKET-NAME>
s3_region <BUCKET-REGION>
path syslog/%Y/%m/%d/
store_as gzip
<buffer tag,time>
@type file
path /var/log/td-agent/buffer/s3
timekey 300 # 5분 파티션
timekey_wait 2m
timekey_use_utc true # UTC 사용
chunk_limit_size 256m
</buffer>
<format>
@type single_value
</format>
</match>$ sudo systemctl start td-agent.service $ sudo systemctl status td-agent.service