Web Analytics Log Processing Script
Analyze server or event logs for insights.
The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.
Write a script to analyze server or event logs for insights. Log format and sample lines: [LOG_FORMAT_AND_SAMPLE_LINES]. Language: [LANGUAGE]. Questions to answer: [QUESTIONS]. Volume and where logs live: [VOLUME_AND_LOCATION]. Privacy requirements: [PRIVACY_REQUIREMENTS]. Follow the structure of this example for a web server access log. Sample line: 203.0.113.9 - - [10/Oct/2026:13:55:36 +0000] "GET /pricing HTTP/1.1" 200 5120 "https://example.com/" "Mozilla/5.0" Parse with a regular expression into ip, time, method, path, status, bytes, referrer, user_agent. Clean: drop requests for static assets and known bots (list the rules), convert times to UTC. Metrics: requests per page, unique visitors per day (hash the IP with a daily salt, then discard raw IPs), top referrers, error rate by path, slowest paths if timings exist. Output: a CSV of daily metrics and a short text summary. Write the full script for my format with streaming (do not load huge files in memory), a test with the sample lines, handling of malformed lines (count and log them), privacy steps (truncate or hash IPs, no query strings with tokens), and a table showing each question and the metric that answers it. Explain what logs cannot tell us (for example human intent) and where results are approximate.
Fill in before use
Optional: type your details and the prompt above updates. Nothing is saved or sent.
Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.