Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apache-log-to-csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def main(**kwargs):

for line in lines:
try:
log_line_data = line_parser(line)
log_line_data = line_parser(str(line))
except apache_log_parser.LineDoesntMatchException as ex:
print(Colors.FAIL + 'The format specified does not match the log file. Aborting...' + Colors.ENDC, file=progressFile)
print('Line: ' + ex.log_line + 'RegEx: ' + ex.regex, file=progressFile)
Expand All @@ -101,7 +101,7 @@ def main(**kwargs):


if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Convert Apache logs to csv', version='%(prog)s 1.0')
parser = argparse.ArgumentParser(description='Convert Apache logs to csv') #, version='%(prog)s 1.0')
parser.add_argument('--format', '-f', type=str, help='Apache log format (see http://httpd.apache.org/docs/2.2/logs.html)')
parser.add_argument('--input', '-i', type=str, help='Input log file ex. /var/log/apache/access.log', default='-')
parser.add_argument('--output', '-o', type=str, help='Output csv file ex. ~/accesslog.csv', default='-')
Expand Down