A Log Analysis Assistant Built on Lanyun MaaS Turns Scattered Errors into Actionable Fault Chains
Log analysis tools that produce unstructured chat answers create more noise than value. This approach shows how to constrain a model into a verifiable workflow where every conclusion links back to a specific log line, speculation is labeled, and the output is machine-readable JSON ready for automation.
A new log analysis assistant processes uploaded or pasted logs through a local Flask app that calls Lanyun MaaS's Qwen3.7-Plus model. Instead of generating freeform explanations, the tool constrains output to a structured format: overall risk level, anomaly types with confidence scores, verbatim log evidence, possible causes explicitly marked as speculation, and concrete investigation actions. The local program handles file encoding, line numbering, and length truncation, while the model handles semantic understanding and anomaly merging.
Five test scenarios validate the tool's behavior. An 8-line error log is correctly linked into a database connection pool exhaustion chain. A 12-line INFO-only log returns no anomalies, proving the model won't fabricate faults. Repeated errors across 15 lines are merged into three event patterns rather than listed individually. A 420-line truncated input triggers an explicit warning that the analysis covers only a partial view. A sanitized production-style log with authentication failures and circuit-breaker events is correctly split by service.
The tool exports structured JSON with fields like evidence, confidence, and actions, making the output suitable for downstream alerting or ticketing systems. Lanyun MaaS provides the model selection console, OpenAI-compatible API endpoint, and separate key management that let the project integrate without rewriting existing SDK-based code.
Most log analysis demos stop at generating a natural-language answer; this tool's real contribution is enforcing a schema that separates fact from speculation and ties every claim to a source line.
The five test scenarios are deliberately adversarial: they check not just whether the model finds errors, but whether it stays silent when logs are clean, merges repetition, and admits when input is incomplete.
Separating the local program's responsibilities (encoding, truncation, validation) from the model's (semantic understanding) creates an auditable pipeline where neither side can silently corrupt the output.
Structured JSON output is the bridge between a human-readable dashboard and an automated workflow; without it, the tool remains a one-off debugging aid rather than a component in an ops pipeline.