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

To avoid forking this project it'd be cool if measures to address the following were added

Open ablsc opened this issue 2 years ago • 0 comments

So the regular expression generated from the log format gets pinned to the end of the line (looks like the following line of code does it index.js:32 - regex = '(.+)$';). It'd be convenient if the module made it configurable whether to lock to EOL or SOL.

The parser produces a lossy result ie. the result that can't be taken to generate the original input. In particular I'm referring to the translation of dashes/hypens to null (looks like the following line of code does it index.js:170 - if (row[key] === '-') {). Adding this change admittedly wouldn't mean the original line could be generated from the parsed result as we're not tracking the amount of whitespace between each item but. For this change I assume other users of the module are depending on dashes being parsed out as null so when constructing the parser object in addition to providing the format, optional parameters of whether to maintain dashes and whether to pin the regex to end or start of the line could be added.

ablsc avatar Jun 06 '23 14:06 ablsc