#!/usr/bin/env python # This script watches a log and prints out hits as they happen. # # usage: ./log_watch.py [logfile] import sys, time from weblog import combined file = open(sys.argv[1]) log = combined.Parser(file) while 1: while log.getlogent(): print "host: %s\n page: %s" % (log.client, log.url) file.seek(0, 1) time.sleep(5)