Python Prompts Free Prompt

Python Script to Parse Log Files and Generate Statistics

Create a Python script that parses server log files (e.g., Apache, Nginx) and generates statistics
☆ Save
Prompt
You are a Python developer. Write a script that reads an access log file and extracts useful statistics: number of requests per IP, most requested pages, HTTP status codes, etc. The script must: 1) Accept log file path, 2) Use regular expressions to parse log lines, 3) Count occurrences, 4) Generate summary report in text or CSV, 5) Create bar charts using matplotlib, 6) Handle large files efficiently (streaming), 7) Provide command-line options for filters (date range, IP). Add comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.