Joao Figueiredo Joao Figueiredo - 1 year ago 120
C++ Question

C++ library for log parsing

Is there any C++ library specifically for log parsing (helping recognize multiline events)?
Like MergeLog for Apache logs or libcurl for web parsing?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download