> 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 Source](/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을 시작하는 데 유용합니다.

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

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

```yaml
[SERVICE]
    log_level trace

[INPUT]
    Name dummy
    Dummy {"message": "sample json message", "type": "json"}

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

[OUTPUT]
    Name   stdout
    Match  *
```

이 구성의 결과는 다음과 같습니다:

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

## 로컬 파일을 추적하여 Amazon S3로 전송

이 예제는 Tail 입력을 사용하여 로컬에서 S3로 전송된 파일을 수집합니다. 여러 파일을 제공할 수 있습니다. 다음을 참조하세요. `path` 의 설정 [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
    Tag        wifi_log
    Path       /var/log/wifi.log

[OUTPUT]
    Name       s3
    Match      *
    Region     {REGION}
    Bucket     {BUCKET_NAME}
    Compression gzip
    json_date_key false
    upload_timeout 5m
    log_key log

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

[OUTPUT]
    Name   stdout
    Match  *
```

이 구성의 결과는 다음과 같습니다:

```
# 파일을 tailing한 입력 결과:
Mon Feb  5 16:17:04.165 USB 호스트 알림 hostNotificationUSBDeviceInserted USB Billboard Device    isApple N seqNum 454 Total 4
Mon Feb  5 16:17:04.176 USB 호스트 알림 Apple80211Set: seqNum 454 Total 4 chg 1 en0
Mon Feb  5 16:17:28.841 USB 호스트 알림 hostNotificationUSBDeviceInserted USB MICROPHONE isApple N seqNum 455 Total 5
Mon Feb  5 16:17:28.846 USB 호스트 알림 Apple80211Set: seqNum 455 Total 5 chg 1 en0
    
# AWS S3의 출력 결과:
Mon Feb  5 16:17:04.165 USB 호스트 알림 hostNotificationUSBDeviceInserted USB Billboard Device    isApple N seqNum 454 Total 4
Mon Feb  5 16:17:04.176 USB 호스트 알림 Apple80211Set: seqNum 454 Total 4 chg 1 en0
Mon Feb  5 16:17:28.841 USB 호스트 알림 hostNotificationUSBDeviceInserted USB MICROPHONE isApple N seqNum 455 Total 5
Mon Feb  5 16:17:28.846 USB 호스트 알림 Apple80211Set: seqNum 455 Total 5 chg 1 en0
```

## TCP에서 Amazon S3로

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

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

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

```yaml
[SERVICE]
    log_level trace

[INPUT]
    Name       tcp
    Tag        tcp_log
    Listen     0.0.0.0
    Port       5140
    Format     none

[OUTPUT]
    Name       s3
    Match      *
    Region     {REGION}
    Bucket     {BUCKET_NAME}
    Compression gzip
    json_date_key false
    upload_timeout 5m
    log_key log

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

[OUTPUT]
    Name   stdout
    Match  *
```

이 구성의 결과는 다음과 같습니다:

```
# 입력 명령:
%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]
    Name       tcp
    Tag        tcp_log
    Listen     0.0.0.0
    Port       5140
    Format     none

# https://stackoverflow.com/questions/75291515/how-to-disable-json-format-and-send-only-the-log-message-to-sumologic-with-fluen
[FILTER]
    Name record_modifier
    Match *
    Record 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]
    Name nest
    Match *
    Operation nest
    와일드카드 headers.*
    Nest_under headers
    Remove_prefix headers.


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

[OUTPUT]
    Name   stdout
    Match  *
```

이 구성의 결과는 다음과 같습니다:

```
# 입력 명령: 
% 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.
