From 4f1c09867d2ccf1710d72b370ebead0a4351ad8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Wed, 10 Dec 2014 07:09:05 +0100 Subject: [PATCH] WIP --- iwla.py | 5 +++-- plugins/post_analysis/referers.py | 21 ++++++++++++++------ plugins/post_analysis/reverse_dns.py | 27 ++++++++++++++++++++++++++ plugins/post_analysis/top_downloads.py | 26 +++++++++++++++++++++++++ plugins/pre_analysis/page_to_hit.py | 3 ++- plugins/pre_analysis/robots.py | 3 ++- 6 files changed, 75 insertions(+), 10 deletions(-) diff --git a/iwla.py b/iwla.py index 1566dd5..d24dacc 100755 --- a/iwla.py +++ b/iwla.py @@ -25,7 +25,8 @@ from display import * # Parse Log, compute them, call plugins and produce output # For now, only HTTP log are valid # -# Plugin requirements : None +# Plugin requirements : +# None # # Conf values needed : # analyzed_filename @@ -582,7 +583,7 @@ class IWLA(object): print '==> Load previous database' self.meta_infos = self._deserialize(conf.META_PATH) or self._clearMeta() - if self.meta_infos['last_time']: + if 'last_time' in self.meta_infos.keys(): self.current_analysis = self._deserialize(self.getDBFilename(self.meta_infos['last_time'])) or self._clearVisits() else: self._clearVisits() diff --git a/plugins/post_analysis/referers.py b/plugins/post_analysis/referers.py index d689aa5..100ab6b 100644 --- a/plugins/post_analysis/referers.py +++ b/plugins/post_analysis/referers.py @@ -11,11 +11,11 @@ import awstats_data # # Extract referers and key phrases from requests # -# Plugin requirements : None +# Plugin requirements : +# None # # Conf values needed : -# page_to_hit_conf* -# hit_to_page_conf* +# domain_name # # Output files : # None @@ -24,9 +24,18 @@ import awstats_data # None # # Statistics update : -# visits : -# remote_addr => -# robot +# month_stats : +# referers => +# pages +# hits +# robots_referers => +# pages +# hits +# search_engine_referers => +# pages +# hits +# key_phrases => +# phrase # # Statistics deletion : # None diff --git a/plugins/post_analysis/reverse_dns.py b/plugins/post_analysis/reverse_dns.py index 9ffb8ab..aecd38a 100644 --- a/plugins/post_analysis/reverse_dns.py +++ b/plugins/post_analysis/reverse_dns.py @@ -3,6 +3,33 @@ import socket from iwla import IWLA from iplugin import IPlugin +# +# Post analysis hook +# +# Replace IP by reverse DNS names +# +# Plugin requirements : +# None +# +# Conf values needed : +# reverse_dns_timeout* +# +# Output files : +# None +# +# Statistics creation : +# None +# +# Statistics update : +# valid_visitors: +# remote_addr +# dns_name_replaced +# dns_analyzed +# +# Statistics deletion : +# None +# + class IWLAPostAnalysisReverseDNS(IPlugin): DEFAULT_DNS_TIMEOUT = 0.5 diff --git a/plugins/post_analysis/top_downloads.py b/plugins/post_analysis/top_downloads.py index 65f0b3f..20cc05f 100644 --- a/plugins/post_analysis/top_downloads.py +++ b/plugins/post_analysis/top_downloads.py @@ -3,6 +3,32 @@ import re from iwla import IWLA from iplugin import IPlugin +# +# Post analysis hook +# +# Count TOP downloads +# +# Plugin requirements : +# None +# +# Conf values needed : +# reverse_dns_timeout* +# +# Output files : +# None +# +# Statistics creation : +# None +# +# Statistics update : +# month_stats: +# top_downloads => +# uri +# +# Statistics deletion : +# None +# + class IWLAPostAnalysisTopDownloads(IPlugin): def __init__(self, iwla): super(IWLAPostAnalysisTopDownloads, self).__init__(iwla) diff --git a/plugins/pre_analysis/page_to_hit.py b/plugins/pre_analysis/page_to_hit.py index ff05f0a..fd8ad87 100644 --- a/plugins/pre_analysis/page_to_hit.py +++ b/plugins/pre_analysis/page_to_hit.py @@ -7,7 +7,8 @@ from iplugin import IPlugin # Pre analysis hook # Change page into hit and hit into page into statistics # -# Plugin requirements : None +# Plugin requirements : +# None # # Conf values needed : # page_to_hit_conf* diff --git a/plugins/pre_analysis/robots.py b/plugins/pre_analysis/robots.py index e2db3aa..83a31a4 100644 --- a/plugins/pre_analysis/robots.py +++ b/plugins/pre_analysis/robots.py @@ -10,7 +10,8 @@ import awstats_data # # Filter robots # -# Plugin requirements : None +# Plugin requirements : +# None # # Conf values needed : # page_to_hit_conf*