ModSecurity-log-utilities
ModSecurity-log-utilities copied to clipboard
Tabs and indentation errors prevent modsec-log-parser working with python3
Ubuntu 20.04 installs python3 by default.
When executing modsec-log-parser.py, error is raised:
File "./modsec-log-parser.py", line 50
for xx in summary.split(","):
^
TabError: inconsistent use of tabs and spaces in indentation
I tried to solve the error by replacing tabs with spaces, to no avail:
sed 's/\t/ /g' modsec-log-parser.py > modsec-log-parser.py3
./modsec-log-parser.py3 --summary="uri,id,msg" /var/log/modsec_audit.log
File "./modsec-log-parser.py3", line 62
print str(i)
^
IndentationError: expected an indented block
Please fix these indentations!
yeah. i've tried this on debian11 with python3 and on os x with python 3 and getting the exact same results.
for xx in summary.split(","):
TabError: inconsistent use of tabs and spaces in indentation