Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/stats/bin/logprocessor.py

Issue 6312256635666432: Issue 1426 - Don`t ignore redirects during stats processing (Closed)
Patch Set: Created Sept. 22, 2014, 10:50 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sitescripts/stats/common.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/stats/bin/logprocessor.py
===================================================================
--- a/sitescripts/stats/bin/logprocessor.py
+++ b/sitescripts/stats/bin/logprocessor.py
@@ -374,20 +374,21 @@ def parse_record(line, ignored, geo, geo
if log_regexp == None:
log_regexp = re.compile(r'(\S+) \S+ \S+ \[([^]\s]+) ([+\-]\d\d)(\d\d)\] "GET ([^"\s]+) [^"]+" (\d+) (\d+) "([^"]*)" "([^"]*)"(?: "[^"]*" \S+ "[^"]*" "[^"]*" "([^"]*)")?')
match = re.search(log_regexp, line)
if not match:
return None
status = int(match.group(6))
- if status != 200:
+ if status not in (200, 301, 302):
return None
info = {
+ "status": status,
"size": int(match.group(7)),
}
info["ip"], info["country"] = process_ip(match.group(1), geo, geov6)
info["time"], info["month"], info["day"], info["weekday"], info["hour"] = parse_time(match.group(2), int(match.group(3)), int(match.group(4)))
info["file"], info["query"] = parse_path(match.group(5))
info["referrer"] = match.group(8)
info["ua"], info["uaversion"] = parse_ua(match.group(9))
« no previous file with comments | « no previous file | sitescripts/stats/common.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld