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