How microsoft/log_analyzer works
Project type and purpose
• This is an open-source CLI tool (“Log Analyzer”) written in Python for server/hardware debugging.
• Its primary purpose is to ingest various log formats, apply AI-powered analysis (via a local LLM), compare against “good” baseline logs, detect error signatures, optionally query Azure DevOps, and emit textual/HTML reports.
File structure
• Top-level files:
• log_analyzer/log_analyzer.py – the main entry point and orchestrator
• common/lib_log.py – core analysis engine (signature matching, LLM integration, diff logic)
• common/llm_config.json – local LLM configuration (model, endpoint, timeouts)
• sut/settings.sample.json – template for error-signature configs (per signature JSON under sut/)
• requirements.txt – Python dependencies
• Directories for extensibility:
• tools/SEL/ – user-provided BMC SEL decoder hooks
• tools/GB_CPER_Decoder/ – user-provided CPER decoder hooks
• Configurable external integrations:
• Local LLM service (e.g., Ollama, vLLM)
• Azure DevOps (ADO) via REST/API
README for additional insights
• Describes the 4-stage workflow: Initialize → Pre-process → Analyze → Post-process
• Key components: CLI orchestrator, analysis engine (lib_log), signature configs, decoder hooks, report generators
• Lists output artifacts: .log, .html, CSV, diff files
Elements
• Clear labels for each module (e.g., “Pre-processor”, “Analysis Engine”)
• Green for config files & JSONs
• Orange for external services (LLM, ADO)
• Layer 1: User invokes CLI with flags
• Layer 3: Pre-processor (CSV conversion, decoder hooks)
• Layer 4: Analysis engine (signature matcher, diff, LLM integration)