📊

Phân tích File Log/Nhật ký

Đọc các file text log khổng lồ, lọc ra các dòng báo Error/Warning và xuất báo cáo Excel.

Excel ⭐⭐ Intermediate ⏱️ 5 phút

😫 Vấn đề (The Pain Point)

Hệ thống phần mềm sinh ra file log nặng 500MB mỗi ngày. Khi có lỗi, bạn mở Notepad lên tìm chữ “Error” thì máy treo.

🚀 Giải pháp Agentic (The Solution)

Tool “Log Parser”: Đọc file text dòng-theo-dòng (không load hết vào RAM), bắt từ khóa lỗi và thống kê.

Tính năng:

  • Keyword Filter: Chỉ trích xuất dòng chứa “ERROR”, “CRITICAL”.
  • Timeline: Thống kê xem lỗi xảy ra nhiều nhất vào giờ nào (đọc timestamp).

Log Analyzer Screenshot

🤖 Engineering Prompt (Copy & Paste)

**Role:** Python System Developer

**Task:** Create a "Log File Analyzer".

**Requirements:**
1.  **Tech Stack:** Python, `tkinter`, `pandas`.
2.  **GUI:**
    *   Input Log File (.txt, .log).
    *   Keywords (comma separated, e.g., ERROR, WARNING, FAIL).
    *   "Scan" button.
3.  **Logic:**
    *   Read file line by line (memory efficient).
    *   If line contains keyword -> Add to list.
    *   Extract Timestamp if possible (Regex: `\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}`).
    *   Export results to Excel.
4.  **Deliverables:**
    *   `log_parser.py`
    *   `run.bat`
    *   `requirements.txt`

**Context:** IT support troubleshooting server issues.

🧠 Giải mã Prompt

  • Line-by-line Reading: Cách đọc file thông minh này giúp tool xử lý được file log nặng hàng GB mà không làm đơ máy tính (khác với việc mở bằng Word/Notepad).

🛠️ Hướng dẫn

  1. Copy Prompt -> Paste -> Chạy.
  2. Chọn file Log -> Nhập “ERROR” -> Scan.

Workflows liên quan

Khám phá danh mục khác

📬

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

📖 Free eBook Guide 📦 7 Ready-to-use Scripts 🔔 Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.