Fluentd를 통한 Windows 이벤트 로그를 S3로 전송하기(레거시)
개요
사전 요구 사항
Fluentd 설정
1단계. Fluentd 설치
2단계. Fluentd 구성 편집
C:\opt\td-agent\etc\td-agent\td-agent.conf<source>
@type windows_eventlog2
@id windows_eventlog2
channels application,system,security
tag system
render_as_xml true
<storage>
persistent false
</storage>
parse_description false
read_existing_events false
</source>
<match system.**>
@type s3
s3_bucket <BUCKET-NAME>
s3_region <BUCKET-REGION>
path winevent/%Y/%m/%d/
store_as gzip
## 아래에는 두 가지 인증 방법이 있습니다.
## 이것이 EC2에서 실행 중인 경우, 토큰 키 대신 역할 위임(assume role) 자격 증명을 사용할 수 있습니다
## 비밀 토큰 인증
#aws_key_id <ACCESS-KEY-ID>
#aws_sec_key <SECRET-KEY>
## 역할 위임(Assume Role) 인증
<assume_role_credentials>
duration_seconds 3600
role_arn <ROLE-ARN>
role_session_name "#{Socket.gethostname}-panther-audit"
</assume_role_credentials>
<buffer tag,time>
@type file
path /var/log/fluent/s3
timekey 300 # 5분 파티션
timekey_wait 2m
timekey_use_utc true # UTC 사용
chunk_limit_size 256m
</buffer>
<format>
@type json
</format>
</match>
#<match system.**>
# @type kinesis_firehose
# region <STREAM-REGION>
# delivery_stream_name <FIREHOSE-STREAM-NAME>
#
# <assume_role_credentials>
# duration_seconds 3600
# role_arn <ROLE-ARN>
# role_session_name "#{Socket.gethostname}-panther-audit"
# </assume_role_credentials>
# <format>
# @type json
# </format>
#</match>3단계. Fluentd 시작
4단계. 로깅 확인
Panther 콘솔
1단계. 커스텀 스키마 생성
2단계. S3 버킷 온보딩
마지막 업데이트
도움이 되었나요?

