forked from saymedia/journald-cloudwatch-logs
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrecord.go
More file actions
60 lines (54 loc) · 1.62 KB
/
record.go
File metadata and controls
60 lines (54 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package main
type Priority int
const (
EMERGENCY Priority = 0
ALERT Priority = 1
CRITICAL Priority = 2
ERROR Priority = 3
WARNING Priority = 4
NOTICE Priority = 5
INFO Priority = 6
DEBUG Priority = 7
)
var PriorityName = map[Priority]string{
EMERGENCY: "EMERG",
ALERT: "ALERT",
CRITICAL: "CRITICAL",
ERROR: "ERROR",
WARNING: "WARNING",
NOTICE: "NOTICE",
INFO: "INFO",
DEBUG: "DEBUG",
}
type Record struct {
InstanceId string
TimeUsec int64
PID int `journald:"_PID"`
UID int `journald:"_UID"`
GID int `journald:"_GID"`
Command string `journald:"_COMM"`
Executable string `journald:"_EXE"`
CommandLine string `journald:"_CMDLINE"`
SystemdUnit string `journald:"_SYSTEMD_UNIT"`
BootId string `journald:"_BOOT_ID"`
MachineId string `journald:"_MACHINE_ID"`
Hostname string `journald:"_HOSTNAME"`
Transport string `journald:"_TRANSPORT"`
Priority Priority `journald:"PRIORITY"`
Message string `journald:"MESSAGE"`
MessageId string `journald:"MESSAGE_ID"`
Errno int `journald:"ERRNO"`
Syslog RecordSyslog
Kernel RecordKernel
}
type RecordSyslog struct {
Facility int `journald:"SYSLOG_FACILITY"`
Identifier string `journald:"SYSLOG_IDENTIFIER"`
PID int `journald:"SYSLOG_PID"`
}
type RecordKernel struct {
Device string `journald:"_KERNEL_DEVICE"`
Subsystem string `journald:"_KERNEL_SUBSYSTEM"`
SysName string `journald:"_UDEV_SYSNAME"`
DevNode string `journald:"_UDEV_DEVNODE"`
}