chore: replace vendor product name with generic ext_device throughout

- Rename _EXT_DEVICE_CODES → _EXT_DEVICE_CODES, gen_ext_device → gen_ext_device
- Rename corpus output directory ext_device/ → ext_device/
- Update default.yaml placeholder pattern name and description
- Update tests to match new directory and class names
- Corresponding Forgejo issue titles updated (#43, #44, #54)
This commit is contained in:
pyr0ball 2026-06-13 22:03:26 -07:00
parent be134a4465
commit 58680b3b27
3 changed files with 6 additions and 6 deletions

View file

@ -211,10 +211,10 @@ patterns:
domain: media domain: media
description: Plex EasyAudioEncoder (EAC3 Dolby audio transcoder) crashed — service restart required description: Plex EasyAudioEncoder (EAC3 Dolby audio transcoder) crashed — service restart required
# - name: ext_device_device_error # - name: ext_device_error
# pattern: "ERR-\d{4}" # pattern: "ERR-\d{4}"
# severity: ERROR # severity: ERROR
# description: EXT_DEVICE device error code # description: vendor device structured error code
# ── VPN / tunnel patterns ────────────────────────────────────────────────── # ── VPN / tunnel patterns ──────────────────────────────────────────────────

View file

@ -12,7 +12,7 @@ Output tree:
<out>/journald/system.jsonl systemd/kernel journald JSON <out>/journald/system.jsonl systemd/kernel journald JSON
<out>/docker/services.jsonl containerised app stdout <out>/docker/services.jsonl containerised app stdout
<out>/qbittorrent/qbt.log hotio-format qBittorrent log <out>/qbittorrent/qbt.log hotio-format qBittorrent log
<out>/ext_device/device.log EXT_DEVICE device plaintext log <out>/ext_device/device.log vendor device plaintext log
""" """
from __future__ import annotations from __future__ import annotations
@ -308,7 +308,7 @@ def gen_qbittorrent(path: Path, start: datetime, end: datetime, rng: random.Rand
def gen_ext_device(path: Path, start: datetime, end: datetime, rng: random.Random, error_rate: float) -> int: def gen_ext_device(path: Path, start: datetime, end: datetime, rng: random.Random, error_rate: float) -> int:
"""Emit EXT_DEVICE device plaintext log (ISO timestamp + level + ERR/SYS/NET code + message).""" """Emit vendor device plaintext log (ISO timestamp + level + ERR/SYS/NET code + message)."""
lines = 0 lines = 0
with path.open("w") as fh: with path.open("w") as fh:
for dt in _ts_seq(start, end, rng): for dt in _ts_seq(start, end, rng):
@ -326,7 +326,7 @@ _GENERATORS: list[tuple[str, str, Callable]] = [
("journald", "system.jsonl", gen_journald), ("journald", "system.jsonl", gen_journald),
("docker", "services.jsonl", gen_docker), ("docker", "services.jsonl", gen_docker),
("qbittorrent", "qbt.log", gen_qbittorrent), ("qbittorrent", "qbt.log", gen_qbittorrent),
("ext_device", "device.log", gen_ext_device), ("ext_device", "device.log", gen_ext_device),
] ]

View file

@ -129,7 +129,7 @@ class TestQbittorrentFormat:
assert severities <= {"INFO", "WARN", "CRITICAL"} assert severities <= {"INFO", "WARN", "CRITICAL"}
# ── EXT_DEVICE format ──────────────────────────────────────────────────────────────── # ── Vendor device format ────────────────────────────────────────────────────────────────
class TestAvcxFormat: class TestAvcxFormat:
def test_iso_timestamp_prefix(self, tmp_path: Path) -> None: def test_iso_timestamp_prefix(self, tmp_path: Path) -> None: