> ## Documentation Index
> Fetch the complete documentation index at: https://stellar-relay.isoc.ooo/llms.txt
> Use this file to discover all available pages before exploring further.

# 빠른 시작

> Stellar Relay를 먼저 포그라운드에서 테스트한 뒤 검증된 설정으로 systemd 서비스를 구성합니다.

# 빠른 시작

새 환경에서는 **처음부터 systemd로 설치하지 않고 포그라운드에서 실제 전송을 먼저 검증**하는 것을 권장합니다. Alert와 Case가 정상 전달되는 것을 확인한 뒤 설정 마법사에 검증된 값을 입력해 systemd 운영으로 전환합니다.

## 1. Script 준비

```bash theme={null}
git clone https://github.com/isoc-labs/stellar-relay.git
cd Stellar-Case-Alert-to-Sylog
```

Python 3.9+가 필요합니다.

필요한 항목:

* Stellar Cyber API로의 네트워크 접속
* 대상 TCP 수신기로의 네트워크 연결
* **이메일 형식**의 Stellar Cyber User ID
* All-Access API Token

## 2. Foreground 테스트용 Token 설정

```bash theme={null}
export STELLAR_TOKEN='YOUR_ALL_ACCESS_TOKEN'
```

환경변수를 사용하면 Token을 Command Line과 Shell History에 직접 넣지 않아도 됩니다.

## 3. Alert만 먼저 테스트

이 단계에서는 Wizard와 systemd를 사용하지 않습니다.

```bash theme={null}
python3 Stellar_Alert_Case_Syslog.py \
  --host YOUR_STELLAR_HOST \
  --userid YOUR_USER_EMAIL \
  --alert-interval 60 \
  --alert-syslog-ip 10.10.10.20 \
  --alert-syslog-port 5201 \
  --initial-lookback-hours 0 \
  --debug
```

다음을 확인합니다.

* 인증/API 오류 없이 프로세스가 시작되는지
* 설정한 TCP 수신기로 Alert가 들어오는지
* 한 줄에 JSON Object 하나씩 수신되는지

`--initial-lookback-hours 0`은 최초 조회 범위를 1분으로 제한합니다. Alert는 안정화 지연 시간을 반영해 이 1분 조회 구간를 계산합니다.

몇 번의 Fetch Cycle을 확인한 뒤 **Ctrl+C**로 종료합니다.

> [!NOTE]
>
> 운영에서도 Alert만 사용할 예정이라면 이 단계가 성공한 후 Alert와 Case 동시 테스트는 건너뛰어도 됩니다.

## 4. Alert와 Case를 함께 테스트

운영에서 두 데이터 유형을 모두 사용할 경우:

```bash theme={null}
python3 Stellar_Alert_Case_Syslog.py \
  --host YOUR_STELLAR_HOST \
  --userid YOUR_USER_EMAIL \
  --alert-interval 60 \
  --alert-syslog-ip 10.10.10.20 \
  --alert-syslog-port 5201 \
  --case-interval 300 \
  --case-syslog-ip 10.10.10.20 \
  --case-syslog-port 5202 \
  --initial-lookback-hours 0 \
  --debug
```

Alert와 Case가 각각 설정한 목적지에 들어오는 것을 확인한 뒤 **Ctrl+C**로 종료합니다.

두 데이터 유형은 같은 수신기를 사용해도 되고 서로 다른 IP/Port를 사용할 수도 있습니다.

## 5. 검증된 설정을 systemd로 전환

Wizard를 실행합니다.

```bash theme={null}
python3 Stellar_Alert_Case_Syslog.py --setup
```

Foreground 테스트에서 실제로 성공한 값을 입력합니다.

1. Stellar Cyber Host
2. 이메일 형식 User ID
3. All-Access API Token
4. Alert 활성화 여부
5. Case 활성화 여부
6. Alert/Case별 조회 주기와 목적지
7. Initial Lookback

마지막 질문:

```text theme={null}
Run continuously with systemd (auto-start on boot)?
```

에서 **Yes**를 선택합니다.

마법사가 다음 서비스를 설치·활성화·시작합니다.

```text theme={null}
stellar-alert-case-syslog.service
```

## 6. 운영 상태 확인

```bash theme={null}
sudo systemctl status stellar-alert-case-syslog
systemctl is-enabled stellar-alert-case-syslog
sudo journalctl -u stellar-alert-case-syslog -n 20 --no-pager
```

반복되는 API/인증/TCP 전송 오류가 없고 수신기에도 데이터가 계속 들어오면 운영 전환이 완료된 것입니다.

## 7. 운영 중 로그 확인

실시간:

```bash theme={null}
sudo journalctl -u stellar-alert-case-syslog -f
```

최근 50줄:

```bash theme={null}
sudo journalctl -u stellar-alert-case-syslog -n 50 --no-pager
```

오늘 로그:

```bash theme={null}
sudo journalctl -u stellar-alert-case-syslog --since today --no-pager
```

Journal 실시간 보기 상태에서 **Ctrl+C**를 눌러도 서비스는 종료되지 않습니다.

## 권장 배포 순서

```text theme={null}
Download / Clone
      ↓
Foreground Alert 테스트
      ↓
Foreground Alert + Case 테스트 (필요 시)
      ↓
검증된 값을 Setup Wizard에 입력
      ↓
systemd 활성화
      ↓
journalctl로 운영 확인
```

전체 CLI 옵션과 기본값는 [설정](https://stellar-relay.isoc.ooo/ko/configuration.md)을 참고하십시오.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.