# PLC 사용자정의

{% hint style="info" %}
사전 등록 및 점검 사항

* [관리 > 목록](https://docs.plura.io/ko/function/common/management/list) > 응용프로그램 태그 등록
* 수집할 응용프로그램 로그 경로 확인
  {% endhint %}

**Logstash를 이용한 응용프로그램 로그 파싱**

* Logstash는 다양한 소스에서 데이터를 수집하고 변환하여 원하는 대상에 전송할 수 있는 경량 오픈 소스입니다. 주로 서버 측 데이터 처리 파이프라인으로 사용되며, 서버, 웹 서버 액세스, 응용프로그램, 정보보안 제품(방화벽, 웹방화벽 등)에서 비정형 데이터를 효율적으로 수집할 수 있습니다.

***

### 1. Logstash 설정 방법 <a href="#id-0-1" id="id-0-1"></a>

1-1. Logstash 설치

설치 가이드

> <https://github.com/QubitSecurity/Logstash>

1-2. Conf 파일 다운로드

* 예시 응용프로그램: postfix

```sh
cd /etc/logstash/conf.d/

curl -O "https://raw.githubusercontent.com/QubitSecurity/Logstash/main/conf.d/70-postfix-plura.conf"
```

1-3. Postfix 로그 경로 수정

```sh
vi /etc/logstash/conf.d/70-postfix-plura.conf
```

> <https://github.com/QubitSecurity/Logstash/blob/main/conf.d/70-postfix-plura.conf>

```sh
mkdir /etc/logstash/patterns.d
cd /etc/logstash/patterns.d
curl -O "https://raw.githubusercontent.com/QubitSecurity/Logstash/main/patterns.d/grok-postfix"
```

### 2. PLURA-Agent를 이용하여 업로드 설정 <a href="#id-0-2" id="id-0-2"></a>

{% hint style="info" %}
테스트 환경

* 원격지 서버(자식) : CentOS Linux release 7.9.2009 (Core), Postfix, Logstash 설치
* 로그 취합 서버(부모) : CentOS Linux release 7.9.2009 (Core), 라이선스 키 등록 및 실행
  {% endhint %}

설치 가이드

> <https://docs.plura.io/ko/agents/siem/plc>

2-1. Logstash가 설정된 원격지(자식) 서버 등록

2-2. 응용프로그램 서버 등록

* [**시스템** > **시스템 관리** ](https://docs.plura.io/ko/function/common/system/management)> 로그 취합서버(부모) 선택 > 응용프로그램 버튼 클릭

<div><figure><img src="http://127.0.0.1:4000/docs/images/Ins_G/LogCol_Customapp/3.png" alt=""><figcaption></figcaption></figure> <figure><img src="/files/Du5q3znfuihMp5A9Lh98" alt=""><figcaption></figcaption></figure></div>

2-3. 호스트 등록 팝업 > 원격지(자식) 서버 정보 입력

* **응용프로그램 사용자정의 로그 수집 경로:** `/var/log/plura/app-logstash-postfix.log` 입력&#x20;

<figure><img src="/files/HEFxAILOWWmDbfukDvYw" alt=""><figcaption></figcaption></figure>

2-4. Logstash 실행

* 시스템 관리에서 경로 설정 후 Logstash 실행

```
/usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/70-postfix-plura.conf
```

### 3. PLURA 웹에서 확인 <a href="#id-0-3" id="id-0-3"></a>

* 경로: [**전체로그** > **응용프로그램** > **사용자정의**](https://docs.plura.io/ko/function/common/flog/capp) > Postfix
* [**관리** > **사용**](https://docs.plura.io/ko/function/common/management/use) > 응용프로그램 > 사용자정의 설정이 ON 상태인 경우에만 메뉴가 노출됩니다.\[4]&#x20;

<div><figure><img src="http://127.0.0.1:4000/docs/images/Ins_G/LogCol_Customapp/6.png" alt=""><figcaption></figcaption></figure> <figure><img src="/files/bCxxuVwte7IegEtN41oB" alt=""><figcaption></figcaption></figure></div>

* "수정" 버튼 클릭 후, Postfix 항목을 선택

<div><figure><img src="http://127.0.0.1:4000/docs/images/Ins_G/LogCol_Customapp/7.png" alt=""><figcaption></figcaption></figure> <figure><img src="/files/4zPkPXbT2iRcMokxEGsx" alt=""><figcaption></figcaption></figure></div>

* Postfix 로그가 생성되면 PLURA [**전체로그(응용프로그램)**](https://docs.plura.io/ko/function/common/flog/capp)에서 확인됩니다.

<figure><img src="/files/iuzUzIjwokJcAo24bW2z" alt=""><figcaption></figcaption></figure>

### 4. 참고 사이트 <a href="#id-0-4" id="id-0-4"></a>

\[1] [**응용프로그램 로그 업로드 설정하기**](https://docs.plura.io/ko/faq/common/uploadapp)

\[2] [**Logstash 정의**](< https://aws.amazon.com/ko/opensearch-service/the-elk-stack/logstash/>)

## 동영상 안내 <a href="#id-1" id="id-1"></a>

### 1. Postfix 영상 <a href="#id-1-1" id="id-1-1"></a>

{% embed url="<https://youtu.be/YmWLsadlIdM>" %}
<https://youtu.be/YmWLsadlIdM>
{% endembed %}


---

# Agent Instructions: 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:

```
GET https://docs.plura.io/ko/agents/siem/uplc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
