From 85fb01d3463e1b4f5f824982712b1194cf0e92e0 Mon Sep 17 00:00:00 2001 From: John Dickinson Date: Thu, 17 Mar 2011 16:42:58 -0500 Subject: [PATCH] whitelist valid query params to count for stats --- swift/stats/access_processor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swift/stats/access_processor.py b/swift/stats/access_processor.py index 6965ef2b4a..897c23880a 100644 --- a/swift/stats/access_processor.py +++ b/swift/stats/access_processor.py @@ -20,6 +20,8 @@ import copy from swift.common.utils import split_path, get_logger month_map = '_ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split() +LISTING_PARAMS = set( + 'path limit format delimiter marker end_marker prefix'.split()) class AccessLogProcessor(object): @@ -95,7 +97,8 @@ class AccessLogProcessor(object): # (format, path, delimiter, etc.). Save a "1" here # to indicate that this request is 1 request for # its respective key. - d[k] = 1 + if k in LISTING_PARAMS: + d[k] = 1 d['client_ip'] = client_ip d['lb_ip'] = lb_ip d['method'] = method