iwla

iwla Commit Details

Date:2014-12-17 21:06:48 (6 years 7 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:50fb09104ea0b2714e8893cee0b3005b32e8bec9
Parents: 14c1686d981dd9749d6ffebf8499dbaed86cfff4
Message:Filter by domain name

Changes:
Miwla.py (4 diffs)

File differences

iwla.py
124124
125125
126126
127
127128
128129
129130
......
582583
583584
584585
586
587
588
585589
586590
587591
......
609613
610614
611615
612
616
613617
614618
615619
......
637641
638642
639643
640
641
644
642645
643646
644647
self.http_request_extracted = re.compile(r'(?P<http_method>\S+) (?P<http_uri>\S+) (?P<http_version>\S+)')
self.log_re = re.compile(self.log_format_extracted)
self.uri_re = re.compile(r'(?P<extract_uri>[^\?]+)(\?(?P<extract_parameters>.+))?')
self.domain_name_re = re.compile(r'.*%s' % conf.domain_name)
self.plugins = [(conf.PRE_HOOK_DIRECTORY , conf.pre_analysis_hooks),
(conf.POST_HOOK_DIRECTORY , conf.post_analysis_hooks),
(conf.DISPLAY_HOOK_DIRECTORY , conf.display_hooks)]
self.current_analysis['days_stats'][cur_time.tm_mday] = stats
def _newHit(self, hit):
if not self.domain_name_re.match(hit['server_name']):
return False
t = self._decodeTime(hit)
cur_time = self.meta_infos['last_time']
for k in hit.keys():
if hit[k] == '-' or hit[k] == '*':
hit[k] = ''
self._appendHit(hit)
return True
groups = self.log_re.match(l)
if groups:
if not self._newHit(groups.groupdict()):
continue
self._newHit(groups.groupdict())
else:
self.logger.warning("No match for %s" % (l))
#break

Archive Download the corresponding diff file

Branches

Tags