> For the complete documentation index, see [llms.txt](https://docs.panther.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.panther.com/ko/data-onboarding/data-pipeline-tools/fluentd/windows-event-logging-via-fluentd.md).

# Fluentd를 통해 Windows 이벤트 로그를 S3로(레거시)

{% hint style="danger" %}
이 가이드에 설명된 절차는 더 이상 Windows Event Logs 온보딩에 권장되는 방법이 아닙니다. 대신 다음의 지침을 따르세요 [Windows Event Logs](/ko/data-onboarding/supported-logs/windows-event-logs.md), 이는 Fluent Bit을 활용합니다. Fluent Bit 설정 과정은 Fluentd보다 덜 복잡하며 추가 인프라가 필요하지 않습니다.
{% endhint %}

## 개요

이 가이드는 Fluentd를 사용하여 Windows Event Logs를 S3로 전달하는 방법을 제공합니다. AWS Firehose 전송 스트림을 통해 전달하는 방법과 AWS S3 버킷으로 직접 전달하는 두 가지 파이프라인 흐름이 있습니다.

### 사전 요구 사항

이 가이드는 S3 버킷 또는 Firehose가 이미 생성되어 있다고 가정합니다. 이들 리소스를 생성해야 하는 경우, 다음을 참조하세요 [Fluentd 온보딩 가이드](/ko/data-onboarding/data-pipeline-tools/fluentd.md). 리소스를 이미 프로비저닝했다면, 아래 가이드를 필요에 맞게 조정할 수 있습니다.

## Fluentd 설정

### 1단계. Fluentd 설치

Fluentd 설치 [지침](https://docs.fluentd.org/installation/install-by-msi) Windows Event Logs를 수집하려는 Windows 서버에 대해. Fluentd가 서비스로 실행 중인지 확인하려면 설치 지침을 참조하세요.

### 2단계. Fluentd 구성 편집

아래 구성으로 Fluentd 구성을 편집하세요. 이렇게 하면 Fluentd가 다음을 사용하도록 설정됩니다. `windows_eventlog2` 플러그인을 사용하여 이벤트를 읽고 S3로 출력합니다. 다음을 업데이트하세요. `s3_bucket`, `s3_region`, `aws_key_id`, 그리고 `aws_sec_key` 를 아래 구성에서:

```
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>
```

다음에 대해 더 자세히 읽어볼 수 있습니다. `windows_eventlog2` 플러그인 [여기](https://github.com/fluent/fluent-plugin-windows-eventlog#in_windows_eventlog2).

### 3단계. Fluentd 시작

명령 프롬프트에서 아래 명령으로 서비스를 시작하거나 다시 시작하세요. 이전에 실행 중이었다면 서비스를 중지했다가 시작해야 할 수도 있습니다.

```
sc stop fluentdwinsvc
sc start fluentdwinsvc
```

다음 명령으로 서비스가 실행 중인지 확인하세요:

```
sc query fluentdwinsvc
```

서비스 실행의 예상 출력:

```
C:\Users\Administrator>sc query fluentdwinsvc

SERVICE_NAME: fluentdwinsvc
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 4  RUNNING
                                (중지 가능, 일시 중지 가능, 종료 요청 수락)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
```

다음 위치에서 Fluentd 런타임 로그를 확인할 수 있습니다. `C:\opt\td-agent\td-agent.log`

문제 해결을 위해 명령줄에서 td-agent를 실행하고, 다음을 통해 실시간 출력에서 문제를 검토할 수도 있습니다. `C:\opt\td-agent\bin\td-agent -vv`. 수동으로 실행하기 전에 Fluentd 서비스를 중지하세요.

### 4단계. 로깅 확인

몇 분 후 이벤트가 S3 버킷에 기록되고 있는지 확인하세요. 로그는 버킷 내의 다음 경로 아래에 표시되어야 합니다. `winevent/` 접두사.

## Panther 콘솔

### 1단계. 사용자 지정 스키마 만들기

다음으로 이동하세요 **스키마**. 클릭하세요 **+새 스키마** 그런 다음 아래 값을 스키마 필드에 입력하세요:

**이름:** Custom.WindowsEventLogs2\
**설명:** 애플리케이션, 보안, 시스템용 Windows Event Logs

```yaml
#fluentd의 windows_eventlog2 유형에 대한 스키마
버전: 0
필드:
- 이름: TimeCreated
  필수: true
  유형: timestamp
  시간 형식: 
   - rfc3339
  isEventTime: true
- 이름: ActivityID
  필수: true
  유형: string
- 이름: Channel
  필수: true
  유형: string
- 이름: Computer
  필수: true
  유형: string
- 이름: Description
  필수: true
  유형: string
- 이름: EventData
  필수: true
  유형: array
  요소:
    유형: string
- 이름: EventID
  필수: true
  유형: bigint
- 이름: EventRecordID
  필수: true
  유형: bigint
- 이름: Keywords
  필수: true
  유형: string
- 이름: Level
  필수: true
  유형: bigint
- 이름: Opcode
  필수: true
  유형: string
- 이름: ProcessID
  필수: true
  유형: string
- 이름: ProviderGUID
  필수: true
  유형: string
- 이름: ProviderName
  필수: true
  유형: string
- 이름: Qualifiers
  필수: true
  유형: string
- 이름: RelatedActivityID
  필수: true
  유형: string
- 이름: Task
  필수: true
  유형: bigint
- 이름: ThreadID
  필수: true
  유형: string
- 이름: UserID
  필수: true
  유형: string
- 이름: Version
  필수: true
  유형: string
```

위 스키마는 이 가이드 앞부분에 제공된 Fluentd source directive 구성의 로그를 사용하여 생성되었습니다.

### 2단계. S3 버킷 온보딩 <a href="#step-2.-onboard-the-s3-bucket" id="step-2.-onboard-the-s3-bucket"></a>

다음을 따르세요. [S3 소스](/ko/data-onboarding/data-transports/aws/s3.md) 온보딩 문서를 참고하고 이전 설정에서 사용한 S3 버킷을 사용하세요.

로그 유형을 선택하세요 `Custom.WindowsEventLogs2` 그리고 접두사를 `winevent/` 온보딩 단계에서 선택하세요. 버킷 온보딩을 완료하면 이제 데이터가 Panther로 흘러들어가야 합니다!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.panther.com/ko/data-onboarding/data-pipeline-tools/fluentd/windows-event-logging-via-fluentd.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
