C++ library for log parsing [closed] C++ library for log parsing [closed] unix unix

C++ library for log parsing [closed]


Unless you stumble upon a suitable library, my advice would be to use a standalone lexer.

  • Instead of flex + bison, use flex alone (C/C++).
  • Instead of ocamllex + ocamlyacc, use ocamllex alone (OCaml).
  • Ragel (C/C++/Objective C/D/Java/Ruby).

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.