syslog日誌是系統日誌的一種,能夠存放在本地也能夠發送到syslog日誌服務器,安全
可是syslog日誌因爲的格式不統一,在平常工做中審計syslog日誌是一種很麻煩的服務器
事情。不過在2001出現了一份關於syslog標準的協議(建議)。less
生成發送日誌的叫作:Devicessh
轉發的叫作:Relay(能夠做爲Device或Coolector)spa
接收的叫作:Collectordebug
傳輸標準使用UDP,消息大小小於1024個字節,端口使用514調試
PS:只是建議。日誌
syslog日誌能夠分爲三部分:orm
4.1 syslog Message Parts The full format of a syslog message seen on the wire has three discernable parts. The first part is called the PRI, the second part is the HEADER, and the third part is the MSG. The total length of the packet MUST be 1024 bytes or less. There is no minimum length of the syslog message although sending a syslog packet with no contents is worthless and SHOULD NOT be transmitted.
標準格式:<23>Oct 9 23:33:20 192.168.0.1 ssh[1787]: Accepted publickey for root from.blog
PRF部分
Numerical Facility Code 0 kernel messages 內核信息; 1 user-level messages 用戶進程信息; 2 mail system 電子郵件相關信息; 3 system daemons 後臺進程相關信息; 4 security/authorization messages (note 1)
5 messages generated internally by syslogd 系統日誌信息
6 line printer subsystem 打印服務相關信息。
7 network news subsystem 新聞組服務器信息
8 UUCP subsystemuucp 生成的信息
9 clock daemon (note 2) 時鐘守護進程
10 security/authorization messages (note 1) 安全受權信息
11 FTP daemon
12 NTP subsystem 子進程
13 log audit (note 1) 日誌審覈
14 log alert (note 1)日誌警報
15 clock daemon (note 2)
16 local use 0 (local0)本地用戶信息
17 local use 1 (local1)本地用戶信息
18 local use 2 (local2)本地用戶信息
19 local use 3 (local3)本地用戶信息
20 local use 4 (local4)本地用戶信息
21 local use 5 (local5)本地用戶信息
22 local use 6 (local6)本地用戶信息
23 local use 7 (local7)本地用戶信息
Table 1. syslog Message Facilities Note 1 - Various operating systems have been found to utilize Facilities 4, 10, 13 and 14 for security/authorization, audit, and alert messages which seem to be similar. Note 2 - Various operating systems have been found to utilize both Facilities 9 and 15 for clock (cron/at) messages. Each message Priority also has a decimal Severity level indicator. These are described in the following table along with their numerical values. Numerical Severity Code 0 Emergency: system is unusable 緊急狀態:系統沒法使用 1 Alert: action must be taken immediately 警報:必須當即採起行動 2 Critical: critical conditions 臨界:臨界條件 3 Error: error conditions 錯誤:錯誤條件 4 Warning: warning conditions 警告:警告條件 5 Notice: normal but significant condition 通知:正常但重要的條件 6 Informational: informational messages 信息:信息消息 7 Debug: debug-level messages 調試:調試級別消息
Table 2. syslog Message SeveritiesHEADER部分(可選) 包括時間和HOST(主機或IP) 時間 格式爲:MM dd hh:mm:ss 用數字表示 其中月MM爲英文縮寫:Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec 有些長期日誌可能會增長年字段。 HOST 主機或IP,無域名。MSG部分 包括TAG:Content TAG(可選):表示進程名及其進程號;格式:p[343]或p-343 Content:表示應用程序的自定義信息。這是對syslog日誌格式的簡單瞭解,爲之後的日誌審計提供基礎