Skip to content

Instantly share code, notes, and snippets.

@rueckstiess
Created April 2, 2014 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rueckstiess/9926987 to your computer and use it in GitHub Desktop.
Save rueckstiess/9926987 to your computer and use it in GitHub Desktop.
Example of mtools' Log2CodeConverter
from mtools.util.log2code import Log2CodeConverter
l2cc = Log2CodeConverter()
match, _ = l2cc("Mon Oct 7 13:25:15.613 [FileAllocator] done allocating datafile /data/mongodb/db/local.0, size: 64MB, took 0.522 secs")
print match.pattern
print match.matches['r2.4.8']
@rueckstiess
Copy link
Author

The output would be

('done allocating datafile', ',', 'size:', 'MB,', 'took', 'secs')
[('src/mongo/util/file_allocator.cpp', 323, 0, 'log(')]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment