Code Monkey home page Code Monkey logo

Comments (3)

molu8bits avatar molu8bits commented on June 1, 2024

Hi, that's interesting.
Can you provide me your modsecurity version, log type (json/standard) and few logs - let's say 3-5 complete entries from A to Z (please of course anonymize them replacing IP/hostname). I will try to take this into account during next update.

from modsecurity-parser.

evilone144 avatar evilone144 commented on June 1, 2024

Mod_security version: mod_security-2.9.3-1.el6.x86_64
For logs nothing special, SecAuditLogType Serial

for_test.txt

Attached the file:
Tried to run the program

python3 modsecurity-parser.py -x test.xlsx -f for_test inputFileName : for_test ---------- modsec_audit events processed: 3 ---------- ---------- modsec_audit events skipped by INCLUDED/EXCLUDED options or INVALID : 0 ---------- Traceback (most recent call last): File "modsecurity-parser.py", line 689, in <module> outputWithGraphs = modsecViewGraphs(modsec_entries) File "modsecurity-parser.py", line 360, in modsecViewGraphs event_times = list(map(lambda x: datetime.strptime(x, LOG_TIMESTAMP_FORMAT).replace(tzinfo=None), event_times1)) File "modsecurity-parser.py", line 360, in <lambda> event_times = list(map(lambda x: datetime.strptime(x, LOG_TIMESTAMP_FORMAT).replace(tzinfo=None), event_times1)) File "/usr/lib64/python3.6/_strptime.py", line 565, in _strptime_datetime tt, fraction = _strptime(data_string, format) File "/usr/lib64/python3.6/_strptime.py", line 362, in _strptime (data_string, format)) ValueError: time data '10/Mar/2020:12:13:30 --0400' does not match format '%d/%b/%Y:%H:%M:%S %z'

If you replace --0400 to +0400 it works fine.

btw, the issue with the Killed action during the run was related to the amount of available ram(as expected =) )

from modsecurity-parser.

molu8bits avatar molu8bits commented on June 1, 2024

Seems that format with two dashes is very specific to Modsecurity. Anyway I added a piece of code which replaces double '-' to one and later the file is processed without any error. Check latest master and reopen if find any problems.
BTW: your example file is modified and added as 'sample_audit_log/modsec_audit_utc-4.log'.

from modsecurity-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.