ESXi 8.0 设置的 syslog 消息格式符合 RFC 3164 或 RFC 5424 的要求。

RFC 3164 和 RFC 5424 的传输格式定义采用的是扩展的巴科斯范式 (ABNF)。

RFC 3164 传输消息格式

参数
SYSLOG-MSG HEADER SP MSG
HEADER PRI TIMESTAMP SP HOSTNAME SP APP-NAME [PROC-IDENTIFIER] ":"
PRI "<" PRIVAL ">"
PRIVAL 1*3DIGIT;范围 0 ..191(MSG PRI;包含设施和严重性值,与 OR 一起使用)
APP-NAME 1*32PRINTUSASCII
HOSTNAME 1*255PRINTUSASCII
PROC-IDENTIFIER "[ "*DIGITS "]";与 APP-NAME 关联的 PID
TIMESTAMP FULL-DATE "T" UTC-TIME(永不设置 TIME-OFFSET)
FULL-DATE DATE-FULLYEAR "-" DATE-MONTH "-" DATE-MDAY
DATE-FULLYEAR 4DIGIT
DATE-MONTH 2DIGIT ; 01-12
DATE-MDAY 2DIGIT ; 01-28、01-29、01-30、01-31(基于月/年)
UTC-TIME TIME-HOUR ":" TIME-MINUTE ":" TIME-SECOND [TIME-SECFRAC] "Z"
TIME-HOUR 2DIGIT ; 00-23
TIME-MINUTE 2DIGIT ; 00-59
TIME-SECOND 2DIGIT ; 00-59
TIME-SECFRAC "."1*6DIGIT
STRUCTURED-DATA 1*SD-ELEMENT
SD-ELEMENT "[" SD-ID *(SP SD-PARAM) "]"
SD-PARAM PARAM-NAME "%d34 PARAM-VALUE %d34
SD-ID SD-NAME
PARAM-NAME SD-NAME
PARAM-VALUE UTF-8-STRING;字符 '"'、'\' 和 ']' 必须转义。
SD-NAME 1*32PRINTUSASCII;''、SP、']'、%d34 (") 除外
MSG [STRUCTURED-DATA SP] UTF-8-STRING

RFC 5424 传输消息格式

参数
SYSLOG-MSG HEADER SP STRUCTURED-DATA [SP MSG]
HEADER PRI VERSION SP TIMESTAMP SP HOSTNAME SP APP-NAME SP PROCID SP MSGID
PRI "<" PRIVAL ">"
PRIVAL 1*3DIGIT;范围 0 ..191;包含设施和严重性数据
VERSION NONZERO-DIGIT 0*2DIGIT
HOSTNAME 1*255PRINTUSASCII
APP-NAME 1*48PRINTUSASCII
NILVALUE '-'
PROCID NILVALUE | *DIGITS;PID 与 APP-NAME 关联
MSGID NILVALUE
TIMESTAMP FULL-DATE "T" UTC-TIME
FULL-DATE DATE-FULLYEAR "-" DATE-MONTH "-" DATE-MDAY
DATE-FULLYEAR 4DIGIT
DATE-MONTH 2DIGIT ; 01-12
DATE-MDAY 2DIGIT ; 01-28、01-29、01-30、01-31(基于月/年)
UTC-TIME TIME-HOUR ":" TIME-MINUTE ":" TIME-SECOND [TIME-SECFRAC] "Z"
TIME-HOUR 2DIGIT ; 00-23
TIME-MINUTE 2DIGIT ; 00-59
TIME-SECOND 2DIGIT ; 00-59
TIME-SECFRAC "."1*6DIGIT
STRUCTURED-DATA NILVALUE / 1*SD-ELEMENT
SD-ELEMENT "[" SD-ID *(SP SD-PARAM) "]"
SD-PARAM PARAM-NAME " %d34 PARAM-VALUE %d34
SD-ID SD-NAME
PARAM-NAME SD-NAME
PARAM-VALUE UTF-8-STRING;字符 '"'、'\' 和 ']' 必须转义。
SD-NAME 1*32PRINTUSASCII ; except '', SP, ']', %d34 (")
MSG MSG-UTF8
MSG-UTF8 BOM UTF-8-STRING
BOM %xEF.BB.BF