A need a python (preferably) or shell script tailing one or multiple apache log file and sending to the STDOUT some metrics on the file every x seconds. The script must be running in background and not launched with cron.
The metrics to be extracted from the file are:
Number of 2xx code per x seconds
Number of 3xx code
Number of 4xx code
Number of 5xx code
The output produced every x seconds should look like this:
[url removed, login to view] "timestamp" "nb of code" file="name of the apache file tailed"
with one line per type of return code and per file.