diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-25 05:27:52 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-25 05:28:21 +0400 |
commit | 1fac8e8e5c004b0c44abbd89c894ffc3b4120d0a (patch) | |
tree | e268ec375ebee22a0d3d59555008be16129e30e7 /misc | |
parent | dcd8679c4f27090a92980f16b6b0a20365ff315f (diff) |
Fixes #4045, fail log importer if we cannot match a format to the first line of the logfile.
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/log-analytics/import_logs.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py index 5c1ed51c2a..57d7415f2c 100755 --- a/misc/log-analytics/import_logs.py +++ b/misc/log-analytics/import_logs.py @@ -1351,9 +1351,12 @@ class Parser(object): else: logging.debug('Format %s does not match', name) - if format: - logging.debug('Format %s is the best match', format.name) + if not format: + fatal_error("cannot determine the log format using the first line of the log file. Try removing it" + + " or specifying the format with the --log-format-name command line argument.") + return + logging.debug('Format %s is the best match', format.name) return format def parse(self, filename): |