> 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/fluent-bit-onboarding-guide/fluent-bit-configuration-examples.md).

# Fluent Bit 구성 예제

이 페이지의 예제는 Fluent Bit으로 데이터를 수신하고 로그를 Panther로 전송하는 일반적인 방법을 제공하며, 다음을 통해 [HTTP 소스](/ko/data-onboarding/data-transports/http.md) 또는 다음을 통해 [Amazon S3 소스](/ko/data-onboarding/data-transports/aws/s3.md).

{% hint style="warning" %}
아래 예제에서는, `log_level trace` 및 출력 `stdout` 는 설정을 테스트하고 디버그하는 데 사용됩니다. Fluent Bit 구성이 예상대로 작동하면 이들은 제거해야 합니다.
{% endhint %}

## Panther HTTP 소스로의 Dummy

이 예제는 [Fluent Bit의 Dummy 입력](https://docs.fluentbit.io/manual/pipeline/inputs/dummy) 을 사용하여 초당 하나의 이벤트를 생성합니다. 이는 출력 구성을 테스트하고 Fluent Bit을 시작하는 데 유용합니다.

입력: [더미](https://docs.fluentbit.io/manual/pipeline/inputs/dummy)

출력: [HTTP](https://docs.fluentbit.io/manual/pipeline/inputs/http)

```yaml
[SERVICE]
    log_level trace

[INPUT]
    이름 dummy
    더미 {"message": "sample json message", "type": "json"}

[OUTPUT]
    Name       http
    Match      *
    Host       logs.{REDACTED}.runpanther.net
    Port       443
    URI        /http/{REDACTED}
    헤더     x-sender-header {REDACTED}
    Format     json_lines
    TLS        On
    TLS.Verify On
    Json_Date_Key false

[OUTPUT]
    이름   stdout
    일치  *
```

이 구성은 다음과 같은 결과를 냅니다:

```
# 입력 구성:
더미 {"message": "sample json message", "type": "json"}
    
# Panther 파싱 전 원시 이벤트의 출력:
{"message": "sample json message", "type": "json"}
```

## 로컬 파일을 Amazon S3로 Tail

이 예제는 Tail 입력을 사용하여 로컬에서 S3로 전송되는 파일을 수집합니다. 여러 파일을 지정할 수 있습니다. 다음을 참조하세요. `경로` 의 설정 [Fluent Bit Tail 문서](https://docs.fluentbit.io/manual/pipeline/inputs/tail) 자세한 내용은

입력: [Tail](https://docs.fluentbit.io/manual/pipeline/inputs/tail)

출력: [S3](https://docs.fluentbit.io/manual/pipeline/outputs/s3)

{% hint style="info" %}
OUTPUT 플러그인 구성에서:

* 사용합니다`json_date_key false` 추가된 날짜 키를 비활성화합니다.
* 사용합니다 `log_key log` Fluent Bit이 원시 로그만 전송하도록 지정합니다.

이 두 설정을 사용하면 로그 파일의 원시 입력이 Fluent Bit이 추가한 JSON 필드 없이 전송됩니다.
{% endhint %}

```yaml
[SERVICE]
    log_level trace

[INPUT]
    Name       tail
    태그        wifi_log
    경로       /var/log/wifi.log

[OUTPUT]
    이름       s3
    Match      *
    리전     {REGION}
    버킷     {BUCKET_NAME}
    압축 gzip
    json_date_key false
    업로드 시간 초과 5m
    log_key log

    # AWS 자격 증명 가져오기 - https://github.com/fluent/fluent-bit-docs/blob/43c4fe134611da471e706b0edb2f9acd7cdfdbc3/administration/aws-credentials.md

[OUTPUT]
    이름   stdout
    일치  *
```

이 구성은 다음과 같은 결과를 냅니다:

```
# 파일 tailing의 입력 결과:
Mon Feb  5 16:17:04.165 Usb Host Notification hostNotificationUSBDeviceInserted USB Billboard Device    isApple N seqNum 454 Total 4
Mon Feb  5 16:17:04.176 Usb Host Notification Apple80211Set: seqNum 454 Total 4 chg 1 en0
Mon Feb  5 16:17:28.841 Usb Host Notification hostNotificationUSBDeviceInserted USB MICROPHONE isApple N seqNum 455 Total 5
Mon Feb  5 16:17:28.846 Usb Host Notification Apple80211Set: seqNum 455 Total 5 chg 1 en0
    
# AWS S3의 출력 결과:
Mon Feb  5 16:17:04.165 Usb Host Notification hostNotificationUSBDeviceInserted USB Billboard Device    isApple N seqNum 454 Total 4
Mon Feb  5 16:17:04.176 Usb Host Notification Apple80211Set: seqNum 454 Total 4 chg 1 en0
Mon Feb  5 16:17:28.841 Usb Host Notification hostNotificationUSBDeviceInserted USB MICROPHONE isApple N seqNum 455 Total 5
Mon Feb  5 16:17:28.846 Usb Host Notification Apple80211Set: seqNum 455 Total 5 chg 1 en0
```

## Amazon S3로의 TCP

이 예제는 TCP 입력 플러그인을 사용합니다. 이 플러그인은 네트워크를 통해 syslog 또는 JSON 이벤트를 Fluent Bit으로 전송해야 할 때 유용합니다. TCP 플러그인은 수신한 원시 페이로드를 가져와 Output 구성으로 전달합니다.

입력: [TCP](https://docs.fluentbit.io/manual/pipeline/inputs/tcp)

출력: [S3](https://docs.fluentbit.io/manual/pipeline/outputs/s3)

```yaml
[SERVICE]
    log_level trace

[INPUT]
    이름       tcp
    태그        tcp_log
    리스닝     0.0.0.0
    포트       5140
    형식     none

[OUTPUT]
    이름       s3
    Match      *
    리전     {REGION}
    버킷     {BUCKET_NAME}
    압축 gzip
    json_date_key false
    업로드 시간 초과 5m
    log_key log

    # AWS 자격 증명 가져오기 - https://github.com/fluent/fluent-bit-docs/blob/43c4fe134611da471e706b0edb2f9acd7cdfdbc3/administration/aws-credentials.md

[OUTPUT]
    이름   stdout
    일치  *
```

이 구성은 다음과 같은 결과를 냅니다:

```
# 입력 명령:
%echo "message from local echo" | nc 127.0.0.1 5140
%echo "message from local echo" | nc 127.0.0.1 5140

# 접두사 tcp_log/2024/02/06/02/55/generated_filename가 있는 AWS S3의 출력:
로컬 echo의 메시지
로컬 echo의 메시지
```

## TCP에서 HTTP(Panther)로

이 예제 구성은 TCP 입력 플러그인을 사용하여 로그를 수신하고 이를 Panther의 [HTTP 수집](/ko/data-onboarding/data-transports/http.md) 으로 직접 전송하는 방법을 보여줍니다. Fluent Bit의 HTTP 출력 플러그인을 사용합니다.

입력: [TCP](https://docs.fluentbit.io/manual/pipeline/inputs/tcp)

출력: [HTTP](https://docs.fluentbit.io/manual/pipeline/outputs/http)

{% hint style="info" %}
아래 구성에서 필터를 사용하는 것은 로그를 HTTP 대상에 전송할 때 원시 페이로드를 그대로 유지하기 위해 필요합니다. 다음을 참조하세요. [Fluent Bit HTTP 출력 문서](https://docs.fluentbit.io/manual/pipeline/outputs/http) 자세한 내용은
{% endhint %}

```yaml
[SERVICE]
    log_level trace

[INPUT]
    이름       tcp
    태그        tcp_log
    리스닝     0.0.0.0
    포트       5140
    형식     none

# https://stackoverflow.com/questions/75291515/how-to-disable-json-format-and-send-only-the-log-message-to-sumologic-with-fluen
[FILTER]
    이름 record_modifier
    일치 *
    레코드 headers.content-type text/plain

# https://stackoverflow.com/questions/75291515/how-to-disable-json-format-and-send-only-the-log-message-to-sumologic-with-fluen
[FILTER]
    이름 nest
    일치 *
    작업 nest
    와일드카드 headers.*
    headers 아래로 중첩
    접두사 headers. 제거


[OUTPUT]
    Name       http
    Match      *
    Host       logs.{REDACTED}.runpanther.net
    Port       443
    URI        /http/{REDACTED}
    헤더     x-sender-header {REDACTED}
    Format     json_lines
    TLS        On
    TLS.Verify On
    Json_Date_Key false
    body_key   $log
    headers_key $headers

[OUTPUT]
    이름   stdout
    일치  *
```

이 구성은 다음과 같은 결과를 냅니다:

```
# 입력 명령: 
% echo "message from local echo `date`" | nc 127.0.0.1 5140
% echo "message from local echo `date`" | nc 127.0.0.1 5140
% echo "message from local echo `date`" | nc 127.0.0.1 5140

# Panther 파싱 전 원시 이벤트의 출력:
message from local echo Mon Feb 5 19:27:40 PST 2024
message from local echo Mon Feb 5 19:27:52 PST 2024
message from local echo Mon Feb 5 19:27:53 PST 2024
```


---

# 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/fluent-bit-onboarding-guide/fluent-bit-configuration-examples.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.
