0

This is a general question, forgive me if this is common knowledge, I don't even know what exactly to search for.

I deal with enormous logfiles (aren't they all) that are generally in the same format.

Date - Time <username> [calling binary] (error tuple) - severity
Error message
Error information
blank newline

What i would like to do is read each entry and then programmatically work with the errors, for example, delete every entry where user != root. Then delete every error with the following tuple. Then show me what's left, but only those where time is between 12:16 and 14:26

It's no problem to define these log entries vie regex or however.

Does anything like this exist? It must! What's it called? Is there an IDE, a python module?

Any help much appreciated!

Danielle M.
  • 3,607
  • 1
  • 14
  • 31
  • Any reason you just can't use grep and a little bash? If you want to do this in Python you would have to write your own parser. – Matt Jul 01 '14 at 16:02
  • If you want to use Java you can use OtrosLogViewer with BatchMode: https://code.google.com/p/otroslogviewer/wiki/BatchProcessing . To use it you have to define your log format with pattern layout https://code.google.com/p/otroslogviewer/wiki/Log4jPatternLayout – KrzyH Jul 02 '14 at 14:39

0 Answers0