Is there any C++ library specifically for log parsing (helping recognize multiline events)? Like MergeLog for Apache logs or libcurl for web parsing?
Unless you stumble upon a suitable library, my advice would be to use a standalone lexer.
This way you avoid having to define a grammar (which is kind of pointless for log files anyway) and you avoid the dreaded frankenstein-regex-monster sometimes seen in dark places.
I'm not aware of any log parsing libraries. You could always use a general-purpose parser generator, like Boost.Spirit, ANTLR, or lex / yacc; that approach would probably be more work, but it's extremely flexible.
If a parser generator is overkill, then I'd just throw a lot of regexes at the logfiles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With