Syslog handler receives syslog messages and match regular expressions. If regex matches, corresponding counter and last matched timestamp are updated.
If syslog handler is started in syslog-agentX program then matching results are exported in SNMP Subagent.
It can also dump results in many other formats
Initialize protocol and reactor
Parameters: |
|
---|---|
Returns None: |
Syslog handler makes use of message dumpers to write matching values to an optional file passed to syslog handler.
OUTPUT_* are python template strings that should provide: * %%(name)s * %%(value)s * %%(ts)s
which are keys of dictionary that will be dumped to file (or socket, or fifo ... ... you know specialties of Unix file centric world ! :P )
Do not change single OUTPUT_* unless you know what you are doing
XML data exchange format: it is template for xml rendering.
Default = “<name>%(name)s</name><value>%(value)s</value><timestamp>%(ts)s</timestamp>”
Text data exchange format: it is a string with amount of reserved characters for each parameter. NOTE: LEN_* constants are defined by developers. They are necessary to realize fastest message parsing, because they are fixed and known _before_ we read the whole message. They are explained below, do not change them unless you know what you are doing!
Default = “%(name)”+ str(LEN_NAME) + “s%(value)” + str(LEN_VALUE) + “s%(ts)” + str(LEN_TIMESTAMP) + “s”
Amount of characters reserved for name of regular expression (first parameter for a tuple in MSG_REGEX_LIST).
Default = 100
Amount of characters reserved for value (counter).
Default = 20
Amount of characters reserved for timestamp value (last_matched attribute).
Default = 12