Question: use your favorite programming/scripting language to write a program to analyze web server log, and print out the remote client IP, and the number of
use your favorite programming/scripting language to write a program to analyze web server log, and print out the remote client IP, and the number of successful requests (status code 200) made by each remote client.
The link below defines the log format for this exercise:
http://en.wikipedia.org/wiki/Common_Log_Format
For example, if the log file contains the following 5 log entries:
192.168.1.2 - - [17/Sep/2013:22:18:19 -0700] "GET /abc HTTP/1.1" 404 201
192.168.1.2 - - [17/Sep/2013:22:18:19 -0700] "GET /favicon.ico HTTP/1.1" 200 1406
192.168.1.2 - - [17/Sep/2013:22:18:27 -0700] "GET /wp/ HTTP/1.1" 200 5325
192.168.1.2 - - [17/Sep/2013:22:18:27 -0700] "GET /wp/wp-content/themes/twentytwelve/style.css?ver=3.5.1 HTTP/1.1" 200 35292
192.168.1.3 - - [17/Sep/2013:22:18:27 -0700] "GET /wp/wp-content/themes/twentytwelve/js/navigation.js?ver=1.0 HTTP/1.1" 200 863
Your programs output should print:
192.168.1.2 3
192.168.1.3 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
