Skip to content

Commit

Permalink
Fixes #4045, fail log importer if we cannot match a format to the fir…
Browse files Browse the repository at this point in the history
…st line of the logfile.
  • Loading branch information
Benaka Moorthi committed Sep 25, 2013
1 parent dcd8679 commit 1fac8e8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions misc/log-analytics/import_logs.py
Expand Up @@ -1351,9 +1351,12 @@ def detect_format(file):
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):
Expand Down

0 comments on commit 1fac8e8

Please sign in to comment.