ModSecurity-log-utilities icon indicating copy to clipboard operation
ModSecurity-log-utilities copied to clipboard

Not working with Plesk Apache error_log file without optional parameters

Open andp97 opened this issue 4 years ago • 0 comments

Python Version:

python3 -V                                                                                                                                                                                                                
Python 3.8.5
[user@localhost] python3 modsec-log-parser.py error_log
(['error_log'], None)
Traceback (most recent call last):
  File "./modsec-log-parser.py", line 64, in <module>
    main()
  File "./modsec-log-parser.py", line 37, in main
    if len(summary) == 0:
TypeError: object of type 'NoneType' has no len()

With optional parameters works fine:

[user@localhost] python3 modsec-log-parser.py error_log  --summary "id,client,uri" --delim "  " 
225170"  52.xxx.xx.xxx  /wp-json/wp/v2/users/"
942340"  93.xxx.xxx.xxx  /noindex/css/fonts/Bold/OpenSans-Bold.woff"
77210492"  64.xxx.xxx.xxx  /wp-content/plugins/eshop-magic/download.php"
942370"  93.xxx.xxx.xxx  /images/poweredby.png"

I've tried this script after using the fix applied on Pull Request #4

andp97 avatar Oct 22 '20 21:10 andp97