add more streams

This commit is contained in:
larssand
2026-06-22 19:09:25 +02:00
parent f99e699da6
commit a5489d3c87
6 changed files with 115 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ DEFAULT_CONFIG: dict[str, object] = {
"log_source": "local_syslog",
"graylog_mcp_url": "",
"graylog_stream": "",
"graylog_streams": [],
"graylog_query": "*",
"graylog_field_mapping": "",
"llm_enabled": False,
@@ -46,6 +47,11 @@ class ConfigStore:
current[key] = bool(value)
elif key == "log_source" and value in {"local_syslog", "graylog_mcp"}:
current[key] = value
elif key == "graylog_streams" and isinstance(value, list):
current[key] = [
{"id": str(item.get("id", "")), "title": str(item.get("title", "")), "enabled": bool(item.get("enabled"))}
for item in value if isinstance(item, dict) and item.get("id")
]
elif isinstance(value, str):
current[key] = value.strip()
self.path.parent.mkdir(parents=True, exist_ok=True)