modsecurity-parser icon indicating copy to clipboard operation
modsecurity-parser copied to clipboard

Json not vaild

Open ghost opened this issue 5 years ago • 1 comments

Hi, the .json output is not valid, tested on https://jsonlint.com/?code= on sample file modsec_audit2_2018-06-11_20-16-27.json report the following problem:

Error: Parse error on line 61: ...de": "ENABLED" }} { "transaction": { ---------------------^ Expecting 'EOF', '}', ',', ']', got '{'

ghost avatar Aug 11 '20 11:08 ghost

Hi, Yes, you're right. In fact the sample file consists of two separate JSON documents joined together. You can split it on line 61 and verify separately both part against jsonlint.com. The second form of output named "jsonperline" is more appropriate as it should be correct NDJSON output. This output is invalid as JSON document but as I remember during creating stuff I needed just simple JSON-like structure to easily visualise the content in case of few log entries.

molu8bits avatar Aug 13 '20 05:08 molu8bits