diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-06-20 07:55:51 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-06-20 07:55:51 +0400 |
commit | e2e5176279255b7ff2d80f0f511a1ef5f3748ebe (patch) | |
tree | 80ed2cb2fa9fd215c35550242f6d7ec98b8d18a6 /misc | |
parent | 782ceed6f2b4d932c281f8726cf9974f90ba242b (diff) |
Handle log files in log importer where site URL's protocol + host will be prepended to the path even if the path already contains a protocol & host.
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/log-analytics/import_logs.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py index 55192ad3a4..c8bbbb4e6e 100755 --- a/misc/log-analytics/import_logs.py +++ b/misc/log-analytics/import_logs.py @@ -1131,11 +1131,14 @@ class Recorder(object): path = hit.path if hit.query_string and not config.options.strip_query_string: path += config.options.query_string_delimiter + hit.query_string + + # only prepend main url if it's a path + url = (main_url if path.startswith('/') else '') + path[:1024] args = { 'rec': '1', 'apiv': '1', - 'url': (main_url + path[:1024]).encode('utf8'), + 'url': url.encode('utf8'), 'urlref': hit.referrer[:1024].encode('utf8'), 'cip': hit.ip, 'cdt': self.date_to_piwik(hit.date), |