Skip to main content

plantpulse-cep (Complex Event Processing)

Role​

This is the Complex Event Processing layer. It detects temporal and logical patterns of multiple events in real-time to perform alarms, Flow triggers, and automation. Rules are written in EQL (PlantPulse CEP SQL).

ItemValue
Module Nameplantpulse-cep
Installation Path/opt/kopens/plantpulse-platform/plantpulse-cep/
Port7400 (HTTP) · 7401 (TLS)
Execution EngineOne at boot — Aster CEP (cep.backend=aster, same even if not configured)
pd Servicecep — MASTER only
API AuthenticationX-API-Key: <PP_CEP_API_KEY>
Console LoginPP_CEP_WEB_USER / PP_CEP_WEB_PASSWORD — If empty, only the console is closed
Language, backend, operation, and limits are in dedicated sections

This page covers modules and files. For how to write and execute statements, refer to the CEP section.

Usage Example​

"If an alarm is triggered and is not cleared for 30 minutes, report as uncleared"

SELECT a.machineId AS machine
FROM pattern [every a=AlarmEvent -> not ClearEvent for 30 min]

Configuration​

The API, console, and engine are in the same process. Only one engine selected at boot is running.

Directory Structure​

plantpulse-cep/
├── config/plantpulse-cep.properties # 생성물 ← plantpulse-datalake-cli 의 템플릿
├── bin/start.sh
├── logs/
└── server/ # 내장 Tomcat — webapps/ROOT.war · logs/catalina.<date>.log

Key Settings​

# 백엔드 — 부팅 시 하나. 미설정이면 이전 것을 그대로 유지한다
cep.backend=aster
#cep.mode=native # native | portable

# 이벤트 입력 (Valkey 스트림)
cache.host=${PP_REDIS_HOST}
cache.port=${PP_REDIS_PORT}
cache.password=${PP_REDIS_PASSWORD}
cache.ssl.enabled=false
cep.stream.shard_count=16
cep.consumer.thread_count=16

# 룰 · 이벤트 타입 레지스트리 (PostgreSQL datalake DB — CEP 가 표를 스스로 만든다)
jdbc.datalake.url=jdbc:postgresql://${PP_POSTGRES_HOST}:${PP_POSTGRES_PORT}/datalake
jdbc.datalake.username=${PP_DATALAKE_DB_USER}
jdbc.datalake.password=${PP_DATALAKE_DB_PASSWORD}

# 운영 지표 (Cassandra)
storage.host=${PP_CASSANDRA_HOST}
storage.keyspace=${PP_KEYSPACE}
cep.storage.ttl_seconds=864000 # 10일

# 인증
cep.api.key=${PP_CEP_API_KEY}
cep.web.user=${PP_CEP_WEB_USER}
cep.web.password=${PP_CEP_WEB_PASSWORD}
cep.api.max_eql_text_length=100000
cep.flink.* only applies when booted with Flink

cep.flink.reconciler.enabled and cep.flink.router.enabled remain in the same file. If booted with a different backend, they are ignored, and the name is logged once.

There have been cases where these were left on and booted with another backend, resulting in the same statement running on two engines and results being published twice → Backends

The procedure for changing values is How to change configuration, and API key rotation is Change passwords and API keys.

Key APIs​

PathFunction
POST /api/v1/eql/deployStatement registration
POST /api/v1/eql/validateDetermination only — SUPPORTED / UNSUPPORTED / UNPARSEABLE
DELETE /api/v1/eql/undeploy/{id}Deregistration
GET /api/v1/eql/registrationRegistration result table (ACTIVE / REJECTED)
GET /api/v1/eql/portabilityPortability
GET /api/v1/eql/metrics/snapshot · /metrics/engineMatch rate and output rate per statement, engine metrics
GET·POST·PUT·DELETE /api/v1/event-typesEvent type registration
GET·POST·DELETE /api/v1/keysAPI key
GET /api/healthAnonymous readiness — engine, cache, schema

Operational Commands​

docker exec plantpulse-datalake pd status cep
docker exec plantpulse-datalake pd restart cep
docker exec plantpulse-datalake pd logs --lines 200 cep

# 어느 백엔드로 떴나 — 판정 지표는 로그 한 줄이다
docker exec plantpulse-datalake sh -c 'grep "CEP input path" ... | tail -1'

curl -fsS http://127.0.0.1:7400/api/health

Frequently Occurring Issues​

SymptomCauseAction
Registration remains as REJECTEDThe booted backend cannot accept that configurationFind that line in the Rejection token
Registration rejected with 400Unregistered event typeEvent type registration
CEP does not start at allcep.backend typo or missing runtime WARThe log specifies the name. There is no fallback
Results are not arriving anywhereZero subscribersno subscriber in the log
Same result arrives twiceBooted with another backend while cep.flink.* switch was onBackends
Health is DEGRADED, table name in reasonCEP owner table is missingCheck DB connection (jdbc.datalake.*) and restart — it creates itself during startup
API 401API key mismatchpasswd.sh PP_CEP_API_KEY
Console login rejectedPP_CEP_WEB_PASSWORD is emptyWeb screen login accounts