hat.syslog.common

Common syslog data structures

 1"""Common syslog data structures"""
 2
 3import enum
 4import typing
 5
 6
 7__all__ = ['CommType',
 8           'Facility',
 9           'Severity',
10           'Msg']
11
12
13class CommType(enum.Enum):
14    """Syslog communication type"""
15    UDP = 0
16    TCP = 1
17    SSL = 2
18
19
20class Facility(enum.Enum):
21    KERNEL = 0
22    USER = 1
23    MAIL = 2
24    SYSTEM = 3
25    AUTHORIZATION1 = 4
26    INTERNAL = 5
27    PRINTER = 6
28    NETWORK = 7
29    UUCP = 8
30    CLOCK1 = 9
31    AUTHORIZATION2 = 10
32    FTP = 11
33    NTP = 12
34    AUDIT = 13
35    ALERT = 14
36    CLOCK2 = 15
37    LOCAL0 = 16
38    LOCAL1 = 17
39    LOCAL2 = 18
40    LOCAL3 = 19
41    LOCAL4 = 20
42    LOCAL5 = 21
43    LOCAL6 = 22
44    LOCAL7 = 23
45
46
47class Severity(enum.Enum):
48    EMERGENCY = 0
49    ALERT = 1
50    CRITICAL = 2
51    ERROR = 3
52    WARNING = 4
53    NOTICE = 5
54    INFORMATIONAL = 6
55    DEBUG = 7
56
57
58class Msg(typing.NamedTuple):
59    """Message
60
61    `data` containes JSON serialized Dict[str, Dict[str, str]]
62
63    """
64    facility: Facility
65    severity: Severity
66    version: int
67    timestamp: typing.Optional[float]
68    hostname: typing.Optional[str]
69    app_name: typing.Optional[str]
70    procid: typing.Optional[str]
71    msgid: typing.Optional[str]
72    data: typing.Optional[str]
73    msg: typing.Optional[str]
class CommType(enum.Enum):
14class CommType(enum.Enum):
15    """Syslog communication type"""
16    UDP = 0
17    TCP = 1
18    SSL = 2

Syslog communication type

UDP = <CommType.UDP: 0>
TCP = <CommType.TCP: 1>
SSL = <CommType.SSL: 2>
Inherited Members
enum.Enum
name
value
class Facility(enum.Enum):
21class Facility(enum.Enum):
22    KERNEL = 0
23    USER = 1
24    MAIL = 2
25    SYSTEM = 3
26    AUTHORIZATION1 = 4
27    INTERNAL = 5
28    PRINTER = 6
29    NETWORK = 7
30    UUCP = 8
31    CLOCK1 = 9
32    AUTHORIZATION2 = 10
33    FTP = 11
34    NTP = 12
35    AUDIT = 13
36    ALERT = 14
37    CLOCK2 = 15
38    LOCAL0 = 16
39    LOCAL1 = 17
40    LOCAL2 = 18
41    LOCAL3 = 19
42    LOCAL4 = 20
43    LOCAL5 = 21
44    LOCAL6 = 22
45    LOCAL7 = 23

An enumeration.

KERNEL = <Facility.KERNEL: 0>
USER = <Facility.USER: 1>
MAIL = <Facility.MAIL: 2>
SYSTEM = <Facility.SYSTEM: 3>
AUTHORIZATION1 = <Facility.AUTHORIZATION1: 4>
INTERNAL = <Facility.INTERNAL: 5>
PRINTER = <Facility.PRINTER: 6>
NETWORK = <Facility.NETWORK: 7>
UUCP = <Facility.UUCP: 8>
CLOCK1 = <Facility.CLOCK1: 9>
AUTHORIZATION2 = <Facility.AUTHORIZATION2: 10>
FTP = <Facility.FTP: 11>
NTP = <Facility.NTP: 12>
AUDIT = <Facility.AUDIT: 13>
ALERT = <Facility.ALERT: 14>
CLOCK2 = <Facility.CLOCK2: 15>
LOCAL0 = <Facility.LOCAL0: 16>
LOCAL1 = <Facility.LOCAL1: 17>
LOCAL2 = <Facility.LOCAL2: 18>
LOCAL3 = <Facility.LOCAL3: 19>
LOCAL4 = <Facility.LOCAL4: 20>
LOCAL5 = <Facility.LOCAL5: 21>
LOCAL6 = <Facility.LOCAL6: 22>
LOCAL7 = <Facility.LOCAL7: 23>
Inherited Members
enum.Enum
name
value
class Severity(enum.Enum):
48class Severity(enum.Enum):
49    EMERGENCY = 0
50    ALERT = 1
51    CRITICAL = 2
52    ERROR = 3
53    WARNING = 4
54    NOTICE = 5
55    INFORMATIONAL = 6
56    DEBUG = 7

An enumeration.

EMERGENCY = <Severity.EMERGENCY: 0>
ALERT = <Severity.ALERT: 1>
CRITICAL = <Severity.CRITICAL: 2>
ERROR = <Severity.ERROR: 3>
WARNING = <Severity.WARNING: 4>
NOTICE = <Severity.NOTICE: 5>
INFORMATIONAL = <Severity.INFORMATIONAL: 6>
DEBUG = <Severity.DEBUG: 7>
Inherited Members
enum.Enum
name
value
class Msg(typing.NamedTuple):
59class Msg(typing.NamedTuple):
60    """Message
61
62    `data` containes JSON serialized Dict[str, Dict[str, str]]
63
64    """
65    facility: Facility
66    severity: Severity
67    version: int
68    timestamp: typing.Optional[float]
69    hostname: typing.Optional[str]
70    app_name: typing.Optional[str]
71    procid: typing.Optional[str]
72    msgid: typing.Optional[str]
73    data: typing.Optional[str]
74    msg: typing.Optional[str]

Message

data containes JSON serialized Dict[str, Dict[str, str]]

Msg( facility: hat.syslog.common.Facility, severity: hat.syslog.common.Severity, version: int, timestamp: Optional[float], hostname: Optional[str], app_name: Optional[str], procid: Optional[str], msgid: Optional[str], data: Optional[str], msg: Optional[str])

Create new instance of Msg(facility, severity, version, timestamp, hostname, app_name, procid, msgid, data, msg)

Alias for field number 0

Alias for field number 1

version: int

Alias for field number 2

timestamp: Optional[float]

Alias for field number 3

hostname: Optional[str]

Alias for field number 4

app_name: Optional[str]

Alias for field number 5

procid: Optional[str]

Alias for field number 6

msgid: Optional[str]

Alias for field number 7

data: Optional[str]

Alias for field number 8

msg: Optional[str]

Alias for field number 9

Inherited Members
builtins.tuple
index
count