diff options
author | sgiehl <stefan@piwik.org> | 2015-01-22 07:48:21 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-01-22 07:48:21 +0300 |
commit | 165c8865b6f3eb374f5140d8da7b726a0e3ba5fb (patch) | |
tree | 639018b7d4f5a56d2ceec8f18c4b8a6f40f4bd55 /misc | |
parent | a31a25e71b60eb26fac907b52b8c26465c855c0b (diff) | |
parent | 9ed81d72cbaa1ebe382502d9417d7d1ac64dab00 (diff) |
Merge branch 'master' into move_language_report
Conflicts:
tests/PHPUnit/UI
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/log-analytics/import_logs.py | 32 | ||||
-rwxr-xr-x | misc/others/geoipUpdateRows.php | 2 |
2 files changed, 31 insertions, 3 deletions
diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py index 2b530b1fa8..a3036dde56 100755 --- a/misc/log-analytics/import_logs.py +++ b/misc/log-analytics/import_logs.py @@ -600,6 +600,18 @@ class Configuration(object): "in conjuction with --log-format-name=w3c_extended.\n" "Example: --w3c-fields='#Fields: date time c-ip ...'" ) + option_parser.add_option( + '--title-category-delimiter', dest='title_category_delimiter', default='/', + help="If --enable-http-errors is used, errors are shown in the page titles report. If you have " + "changed General.action_title_category_delimiter in your Piwik configuration, you need to set this " + "option to the same value in order to get a pretty page titles report." + ) + option_parser.add_option( + '--dump-log-regex', dest='dump_log_regex', action='store_true', default=False, + help="Prints out the regex string used to parse log lines and exists. Can be useful for using formats " + "in newer versions of the script in older versions of the script. The output regex can be used with " + "the --log-format-regex option." + ) return option_parser def _set_w3c_field_map(self, option, opt_str, value, parser): @@ -1411,10 +1423,14 @@ class Recorder(object): args['cvar'] = '{"1":["HTTP-code","%s"]}' % hit.status if hit.is_error or hit.is_redirect: - args['action_name'] = '%s/URL = %s%s' % ( + args['action_name'] = '%s%sURL = %s%s' % ( hit.status, + config.options.title_category_delimiter, urllib.quote(args['url'], ''), - ("/From = %s" % urllib.quote(args['urlref'], '') if args['urlref'] != '' else '') + ("%sFrom = %s" % ( + config.options.title_category_delimiter, + urllib.quote(args['urlref'], '') + ) if args['urlref'] != '' else '') ) if hit.generation_time_milli > 0: @@ -1427,6 +1443,9 @@ class Recorder(object): if hit.event_name: args['e_n'] = hit.event_name + if hit.length: + args['bw_bytes'] = hit.length + return args def _record_hits(self, hits): @@ -1719,6 +1738,15 @@ class Parser(object): # Make sure the format is compatible with the resolver. resolver.check_format(format) + if config.options.dump_log_regex: + logging.info("Using format '%s'." % format.name) + if format.regex: + logging.info("Regex being used: %s" % format.regex.pattern) + else: + logging.info("Format %s does not use a regex to parse log lines." % format.name) + logging.info("--dump-log-regex option used, aborting log import.") + os._exit(0) + hits = [] for lineno, line in enumerate(file): try: diff --git a/misc/others/geoipUpdateRows.php b/misc/others/geoipUpdateRows.php index f7b5473c3c..44a0802390 100755 --- a/misc/others/geoipUpdateRows.php +++ b/misc/others/geoipUpdateRows.php @@ -34,7 +34,7 @@ if (!Common::isPhpCliMode()) { <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> - <script type="text/javascript" src="../../libs/jquery/dist/jquery.min.js"></script> + <script type="text/javascript" src="../../libs/bower_components/jquery/dist/jquery.min.js"></script> <script type="text/javascript"> (function ($) { var count = <?php echo $count; ?>; |