Home | Trees | Indices | Help |
|
---|
|
Basic normalization flow manager. Normalizers definitions are loaded from a path and checked against the DTD. If the definitions are syntactically correct, the normalizers are instantiated and populate the manager's cache. Normalization priormority is established as follows: * Maximum priority assigned to normalizers where the "appliedTo" tag is set to "raw". They MUST be mutually exclusive. * Medium priority assigned to normalizers where the "appliedTo" tag is set to "body". * Lowest priority assigned to any remaining normalizers. Some extra treatment is also done prior and after the log normalization: * Assignment of a unique ID, under the tag "uuid" * Conversion of date tags to UTC, if the "_timezone" was set prior to the normalization process.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Method Details |
Instantiates a flow manager. The default behavior is to activate every available normalizer.
|
Iterates through normalizers and returns the normalizers' paths.
|
used to add or update a normalizer.
|
Activates normalizers according to what was set by calling set_active_normalizers. If no call to the latter function has been made so far, this method activates every normalizer. |
Sets the active/inactive normalizers. Default behavior is to deactivate every normalizer.
|
This method is the entry point to normalize data (a log). data is passed through every activated normalizer and extra tagging occurs accordingly. data receives also an extra uuid tag. @param data: must be a dictionary with at least a key 'raw' or 'body' with BaseString values (preferably Unicode). Here an example : >>> from logsparser import lognormalizer >>> from pprint import pprint >>> ln = lognormalizer.LogNormalizer('/usr/local/share/normalizers/') >>> mylog = {'raw' : 'Jul 18 15:35:01 zoo /USR/SBIN/CRON[14338]: (root) CMD (/srv/git/redmine-changesets.sh)'} >>> ln.lognormalize(mylog) >>> pprint mylog {'body': '(root) CMD (/srv/git/redmine-changesets.sh)', 'date': datetime.datetime(2011, 7, 18, 15, 35, 1), 'pid': '14338', 'program': '/USR/SBIN/CRON', 'raw': 'Jul 18 15:35:01 zoo /USR/SBIN/CRON[14338]: (root) CMD (/srv/git/redmine-changesets.sh)', 'source': 'zoo', 'uuid': 70851882840934161193887647073096992594L} |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Mar 12 03:22:05 2014 | http://epydoc.sourceforge.net |