Package logsparser :: Module normalizer

[frames] | no frames]

# Module normalizer

source code

Here we have everything needed to parse and use XML definition files.

The only class one should ever use here is Normalizer. The rest is used during the parsing of the definition files that is taken care of by the Normalizer class.

Classes
| Tag A tag as defined in a pattern.
| TagType A tag type.
| PatternExample Represents an log sample matching a given pattern.
| Pattern A pattern, as defined in a normalizer configuration file.
| CSVPattern A pattern that handle CSV case.
| CallbackFunction This class is used to define a callback function from source code present in the XML configuration file.
| Normalizer Log Normalizer, based on an XML definition file.

Functions

country_code_by_address(...) Lookup Country Code By IP Address | source code

get_generic_tagTypes(path=`'``normalizers/common_tagTypes.xml``'`) Imports the common tag types. | source code

get_generic_callBacks(path=`'``normalizers/common_callBacks.xml``'`) Imports the common callbacks. | source code

doc2RST(description, gettext=None) Returns a RestructuredText documentation from a parser description. | source code

Variables
| SAFE_SYMBOLS = ``[``'``list``'``,` `'``dict``'``,` `'``tuple``'``,` `'``set``'``,` `'``long``'``,` `'``float``...``
| __package__ = ``'``logsparser``'``

Function Details

### get_generic_tagTypes(path=`'``normalizers/common_tagTypes.xml``'`)

source code

Imports the common tag types.

Returns:
  a dictionary of tag types.

### get_generic_callBacks(path=`'``normalizers/common_callBacks.xml``'`)

source code

Imports the common callbacks.

@return a dictionnary of callbacks.

### doc2RST(description, gettext=None)

source code

Returns a RestructuredText documentation from a parser description.

Parameters:
  - `description` - the long description of the parser.
  - `gettext` - is the gettext method to use. You must configure gettext to use the domain 'normalizer' and select a language. eg. gettext.translation('normalizer', 'i18n', ['fr_FR']).ugettext

Variables Details

### SAFE_SYMBOLS

Value:

      ['list',
       'dict',
       'tuple',
       'set',
       'long',
       'float',
       'object',
       'bool',
      ...