Skip to content

Not working with Plesk Apache error_log file without optional parameters #5

Open
@andp97

Description

@andp97

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions