Write a Python script at /app/log analyzer.py that reads a system log file (UTF-8, path given as first CLI…
Write a Python script at /app/log analyzer.py that reads a system log file (UTF-8, path given as first CLI…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). The report must be a JSON object with these keys: - "total lines" : number of non-empty lines in the log -…
The task
The report must be a JSON object with these keys: - `"total_lines"`: number of non-empty lines in the log - `"error_count"`: number of lines containing the literal word "ERROR" (case-insensitive match, whole word boundaries not required, so "ERROR", "error", "WarningError" all count) - `"unique_ips"`: total count of…
Part of ai-and/termgrade-environments.