コード例 #1
0
ファイル: test.py プロジェクト: goerz/pyala
from ApacheLogParser import *
from DetailedStatComponent import DetailedStatComponent
from TemplateProcessor import TemplateProcessor
from visit import *
import re

testfiles = [
    r'/home/goerz/public_html/logs/access.log.2007-09.tempcopy.gz'
]

TemplateProcessor.overwrite = True

alp = ApacheLogParser()
alp.compressed = True
#alp.add_includepattern(('hostname', re.compile(r'physik.fu-berlin.de')))
alp.add_excludepattern(('hostname', re.compile(r'googlebot.com')))
alp.add_excludepattern(('hostname', re.compile(r'inktomisearch')))
alp.add_excludepattern(('hostname', re.compile(r'phx.gbl')))
alp.add_excludepattern(('hostname', re.compile(r'search.live.com')))
alp.add_excludepattern(('hostname', re.compile(r'crawl.yahoo.net')))
alp.add_excludepattern(('file', re.compile(r'/images/')))
alp.add_excludepattern(('file', re.compile(r'/fortunes/')))
alp.add_excludepattern(('file', re.compile(r'/pagestyle\.css')))
alp.add_excludepattern(('hostname', re.compile(r'pfeffer\.zedat')))

visits = VisitManager()
visits.add_excludepattern(('is_bot', re.compile(r'Yes')))
Visit.html_template = "../templates/visit.html"

detailedstats = DetailedStatComponent()
detailedstats.set_option('outdir', "../output")