summaryrefslogtreecommitdiffstats
path: root/python.d
diff options
context:
space:
mode:
authorIlya <ilyamaschenko@gmail.com>2017-07-21 18:40:17 +0900
committerIlya <ilyamaschenko@gmail.com>2017-07-21 19:52:17 +0900
commit1ed76ec140fa6495b1a2b0530583f4ec26d8f6a5 (patch)
tree7a3ba77a7b9ff0bdf1d6d811ac39289f4ff4ba09 /python.d
parent0df0c6f62477768bff65ee82c0fac89fd37835ea (diff)
web_log bugfix: check if "all_time" is set to True before collect ips
Diffstat (limited to 'python.d')
-rw-r--r--python.d/web_log.chart.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/python.d/web_log.chart.py b/python.d/web_log.chart.py
index 564c9f1dd5..18670a73de 100644
--- a/python.d/web_log.chart.py
+++ b/python.d/web_log.chart.py
@@ -475,7 +475,6 @@ class Web(Mixin):
unique_current = set()
timings = defaultdict(lambda: dict(minimum=None, maximum=0, summary=0, count=0))
- ip_address_counter = {'unique_cur_ip': 0}
for line in filtered_data:
match = self.storage['regex'].search(line)
if match:
@@ -529,10 +528,11 @@ class Web(Mixin):
proto = 'ipv4' if '.' in match_dict['address'] else 'ipv6'
self.data['req_' + proto] += 1
# unique clients ips
- if address_not_in_pool(pool=self.storage['unique_all_time'],
- address=match_dict['address'],
- pool_size=self.data['unique_tot_ipv4'] + self.data['unique_tot_ipv6']):
- self.data['unique_tot_' + proto] += 1
+ if self.conf.get('all_time', True):
+ if address_not_in_pool(pool=self.storage['unique_all_time'],
+ address=match_dict['address'],
+ pool_size=self.data['unique_tot_ipv4'] + self.data['unique_tot_ipv6']):
+ self.data['unique_tot_' + proto] += 1
if match_dict['address'] not in unique_current:
self.data['unique_cur_' + proto] += 1
unique_current.add(match_dict['address'])