RFC 5424
The Syslog Protocol
RFC 5424: The Syslog Protocol ๐
Okay bestie, this is the big one: RFC 5424, "The Syslog Protocol." Here's the tea on its title block ๐ซถ:
- It's from the Network Working Group ๐
- It's Request for Comments: 5424 ๐
- R. Gerhards of Adiscon GmbH wrote it ๐ฉโ๐ป
- It's dated March 2009 ๐๏ธ
- It's a Standards Track doc, so it's a real Internet standard and not just a suggestion ๐
- It obsoletes 3164, meaning it replaces RFC 3164 ๐
Status of This Memo
Okay so this doc is an Internet standards track protocol for the whole Internet community, and it's literally asking everyone to chat about it and suggest improvements ๐ฃ๏ธโจ. For the official standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1) ๐. And distribution of this memo is unlimited, so share it with your whole group chat ๐.
Copyright Notice
Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved ๐.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents, as they stood on the date this document was published. Please read those carefully, because they spell out your rights and restrictions for this document ๐. You can find them at http://trustee.ietf.org/license-info.
This document may include material from IETF Documents or IETF Contributions that were published or made publicly available before November 10, 2008 ๐ฐ๏ธ. The people who control the copyright in some of that material might not have given the IETF Trust permission to allow modifications outside the IETF Standards Process. So unless you get a proper license from whoever controls those copyrights, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be made outside that process either. The one exceptions are formatting it for publication as an RFC and translating it into languages other than English ๐ธ.
Abstract
This doc describes the syslog protocol, which is used to send around event notification messages ๐ฃ. It uses a layered architecture, so any number of transport protocols can carry syslog messages ๐. It also has a message format that lets vendors add their own extensions in a structured way ๐งฉ.
It was written with the original design goals of traditional syslog in mind ๐. A new layered spec was needed because standardization work on reliable and secure syslog extensions was stuck without a Standards-Track, transport-independent RFC to build on ๐ญ. Without this document, every other standard would have to define its own syslog packet format and transport mechanism, and over time that causes sneaky compatibility issues ๐. This doc tries to be the foundation that syslog extensions can build on ๐๏ธ. The layered approach also means you can write the code once for each syslog feature, instead of once for each transport ๐.
This document obsoletes RFC 3164 ๐ .
Table of Contents
1. Introduction ....................................................4
2. Conventions Used in This Document ...............................4
3. Definitions .....................................................4
4. Basic Principles ................................................5
4.1. Example Deployment Scenarios ...............................6
5. Transport Layer Protocol ........................................7
5.1. Minimum Required Transport Mapping .........................7
6. Syslog Message Format ...........................................8
6.1. Message Length .............................................9
6.2. HEADER .....................................................9
6.2.1. PRI .................................................9
6.2.2. VERSION ............................................11
6.2.3. TIMESTAMP ..........................................11
6.2.4. HOSTNAME ...........................................13
6.2.5. APP-NAME ...........................................14
6.2.6. PROCID .............................................14
6.2.7. MSGID ..............................................14
6.3. STRUCTURED-DATA ...........................................15
6.3.1. SD-ELEMENT .........................................15
6.3.2. SD-ID ..............................................15
6.3.3. SD-PARAM ...........................................16
6.3.4. Change Control .....................................17
6.3.5. Examples ...........................................17
6.4. MSG .......................................................18
6.5. Examples ..................................................19
7. Structured Data IDs ............................................20
7.1. timeQuality ...............................................20
7.1.1. tzKnown ............................................21
7.1.2. isSynced ...........................................21
7.1.3. syncAccuracy .......................................21
7.1.4. Examples ...........................................21
7.2. origin ....................................................22
7.2.1. ip .................................................22
7.2.2. enterpriseId .......................................22
7.2.3. software ...........................................23
7.2.4. swVersion ..........................................23
7.2.5. Example ............................................23
7.3. meta ......................................................24
7.3.1. sequenceId .........................................24
7.3.2. sysUpTime ..........................................24
7.3.3. language ...........................................24
8. Security Considerations ........................................24
8.1. UNICODE ...................................................24
8.2. Control Characters ........................................25
8.3. Message Truncation ........................................26
8.4. Replay ....................................................26
8.5. Reliable Delivery .........................................26
8.6. Congestion Control ........................................27
8.7. Message Integrity .........................................28
8.8. Message Observation .......................................28
8.9. Inappropriate Configuration ...............................28
8.10. Forwarding Loop ..........................................29
8.11. Load Considerations ......................................29
8.12. Denial of Service ........................................29
9. IANA Considerations ............................................30
9.1. VERSION ...................................................30
9.2. SD-IDs ....................................................30
10. Working Group .................................................31
11. Acknowledgments ...............................................31
12. References ....................................................32
12.1. Normative References .....................................32
12.2. Informative References ...................................33
Appendix A. Implementer Guidelines ...............................34
A.1. Relationship with BSD Syslog ..............................34
A.2. Message Length ............................................35
A.3. Severity Values ..........................................36
A.4. TIME-SECFRAC Precision ....................................36
A.5. Case Convention for Names ................................36
A.6. Syslog Applications Without Knowledge of Time ............37
A.7. Notes on the timeQuality SD-ID ............................37
A.8. UTF-8 Encoding and the BOM ................................37
1. Introduction โจ
This doc describes a layered architecture for syslog ๐ฅ. The whole goal is to separate message content from message transport, while keeping each layer easy to extend ๐ง.
It also describes the standard format for syslog messages and lays out the idea of transport mappings ๐บ๏ธ. On top of that, it describes structured data elements. These carry easy-to-parse, structured info, and they leave room for vendor extensions ๐.
This document does not describe any storage format for syslog messages. Storage is outside the scope of the syslog protocol, and it isn't needed for systems to interoperate ๐๏ธ.
This doc was written with the original design goals of traditional syslog in mind. A new layered spec was needed because standardization efforts for reliable and secure syslog extensions were missing a Standards-Track, transport-independent RFC ๐ค. Without this document, every other standard would need to define its own syslog packet format and transport mechanism, and over time that introduces subtle compatibility issues ๐. This doc tries to be a foundation that syslog extensions can build on ๐๏ธ. The layered approach also gives you a solid base for writing code once per syslog feature, instead of once per transport ๐ซถ.
This document obsoletes RFC 3164, which is an Informational document describing some implementations found in the field ๐ท.
2. Conventions Used in This Document ๐
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. These are the official BCP 14 key words, so read them as proper requirement levels, not casual vibes ๐.
3. Definitions ๐งฉ
Syslog is built out of three layers ๐ฐ:
- "syslog content" is the management information contained in a syslog message.
- The "syslog application" layer handles generation, interpretation, routing, and storage of syslog messages.
- The "syslog transport" layer puts messages on the wire and takes them off the wire.
Certain types of functions get performed at each conceptual layer ๐ญ:
- An "originator" generates syslog content to be carried in a message.
- A "collector" gathers syslog content for further analysis.
- A "relay" forwards messages. It accepts messages from originators or other relays, and sends them on to collectors or other relays.
- A "transport sender" passes syslog messages to a specific transport protocol.
- A "transport receiver" takes syslog messages from a specific transport protocol.
Diagram 1 shows the different entities, separated by layer ๐.
+---------------------+ +---------------------+
| content | | content |
|---------------------| |---------------------|
| syslog application | | syslog application | (originator,
| | | | collector, relay)
|---------------------| |---------------------|
| syslog transport | | syslog transport | (transport sender,
| | | | (transport receiver)
+---------------------+ +---------------------+
^ ^
| |
--------------------------
Diagram 1. Syslog Layers
4. Basic Principles โจ
okay so bestie, here are the big vibes of how syslog talks to itself ๐ซถ ๐
- The syslog protocol does not provide acknowledgment of message delivery. Some transports might give you status info, but conceptually syslog is a pure simplex communications protocol. It's one-way, no read receipts, no "seen" ๐
- Originators and relays may be configured to send the same message to multiple collectors and relays. Copies, copies everywhere ๐ฆ
- Originator, relay, and collector functionality may reside on the same system. One device can wear multiple hats, it's giving multitasker ๐
4.1. Example Deployment Scenarios
okay here are some sample setups ๐ง Other arrangements of these are also acceptable, so don't panic if your network looks different. As noted in the diagram, relays may send all or some of the messages they receive, and they can also send messages they generate internally. The boxes are syslog-enabled applications ๐
+----------+ +---------+
|Originator|---->----|Collector|
+----------+ +---------+
+----------+ +-----+ +---------+
|Originator|---->----|Relay|---->----|Collector|
+----------+ +-----+ +---------+
+----------+ +-----+ +-----+ +---------+
|Originator|-->--|Relay|-->--..-->--|Relay|-->--|Collector|
+----------+ +-----+ +-----+ +---------+
+----------+ +-----+ +---------+
|Originator|---->----|Relay|---->----|Collector|
| |-+ +-----+ +---------+
+----------+ \
\ +-----+ +---------+
+->--|Relay|---->----|Collector|
+-----+ +---------+
+----------+ +---------+
|Originator|---->----|Collector|
| |-+ +---------+
+----------+ \
\ +-----+ +---------+
+->--|Relay|---->----|Collector|
+-----+ +---------+
+----------+ +-----+ +---------+
|Originator|---->----|Relay|---->-------|Collector|
| |-+ +-----+ +---| |
+----------+ \ / +---------+
\ +-----+ /
+->--|Relay|-->--/
+-----+
+----------+ +-----+ +---------+
|Originator|---->----|Relay|---->--------------|Collector|
| |-+ +-----+ +--| |
+----------+ \ / +---------+
\ +------------+ /
\ |+----------+| /
+->-||Relay ||->---/
|+----------|| /
||Originator||->-/
|+----------+|
+------------+
Diagram 2. Some Possible Syslog Deployment Scenarios
5. Transport Layer Protocol ๐
this doc doesn't define any transport layer protocol, bestie. Instead it describes the format of a syslog message in a way that doesn't care which transport you use ๐ Syslog transports are defined in other documents. One of them is defined in [RFC5426] and matches the traditional UDP transport. That one's needed for interoperability, because UDP has historically been used to send syslog messages, so it's a whole legacy moment ๐ธ
Any syslog transport protocol MUST NOT deliberately alter the syslog message ๐ โโ๏ธ If the transport protocol needs to do temporary transformations at the transport sender, those transformations MUST be reversed by the transport protocol at the transport receiver. That way the relay or collector sees an exact copy of what the originator or relay generated. Otherwise, end-to-end cryptographic verifiers (like signatures) will break, and that's a disaster ๐ญ Of course, message alteration could still happen due to transmission errors or other problems. Guarding against that is not within the scope of this document, so it's not our job here ๐ซ
5.1. Minimum Required Transport Mapping
All implementations of this specification MUST support a TLS-based transport as described in [RFC5425]. Non-negotiable, bestie ๐
All implementations of this specification SHOULD also support a UDP-based transport as described in [RFC5426].
It is RECOMMENDED that deployments of this specification use the TLS-based transport. So yeah, lowkey the glow-up choice ๐โจ
6. Syslog Message Format ๐
the syslog message has the following ABNF [RFC5234] definition. ABNF is the grammar language, and this is the blueprint for how a message is built ๐งฉ
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 ; range 0 .. 191
VERSION = NONZERO-DIGIT 0*2DIGIT
HOSTNAME = NILVALUE / 1*255PRINTUSASCII
APP-NAME = NILVALUE / 1*48PRINTUSASCII
PROCID = NILVALUE / 1*128PRINTUSASCII
MSGID = NILVALUE / 1*32PRINTUSASCII
TIMESTAMP = NILVALUE / FULL-DATE "T" FULL-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 based on
; month/year
FULL-TIME = PARTIAL-TIME TIME-OFFSET
PARTIAL-TIME = TIME-HOUR ":" TIME-MINUTE ":" TIME-SECOND
[TIME-SECFRAC]
TIME-HOUR = 2DIGIT ; 00-23
TIME-MINUTE = 2DIGIT ; 00-59
TIME-SECOND = 2DIGIT ; 00-59
TIME-SECFRAC = "." 1*6DIGIT
TIME-OFFSET = "Z" / TIME-NUMOFFSET
TIME-NUMOFFSET = ("+" / "-") TIME-HOUR ":" TIME-MINUTE
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 ; characters '"', '\' and
; ']' MUST be escaped.
SD-NAME = 1*32PRINTUSASCII
; except '=', SP, ']', %d34 (")
MSG = MSG-ANY / MSG-UTF8
MSG-ANY = *OCTET ; not starting with BOM
MSG-UTF8 = BOM UTF-8-STRING
BOM = %xEF.BB.BF
UTF-8-STRING = *OCTET ; UTF-8 string as specified
; in RFC 3629
OCTET = %d00-255
SP = %d32
PRINTUSASCII = %d33-126
NONZERO-DIGIT = %d49-57
DIGIT = %d48 / NONZERO-DIGIT
NILVALUE = "-"
6.1. Message Length ๐
message size limits are set by whichever syslog transport mapping you're using. There's no upper limit per se, but each transport mapping defines the minimum maximum required message length support. And that minimum maximum MUST be at least 480 octets in length. Bare minimum, no excuses ๐
Any transport receiver MUST be able to accept messages of up to and including 480 octets in length. All transport receiver implementations SHOULD be able to accept messages of up to and including 2048 octets in length. Transport receivers MAY receive messages larger than 2048 octets in length. If a transport receiver gets a message bigger than it supports, the transport receiver SHOULD truncate the payload. Alternatively, it MAY discard the message. Choose your fighter ๐ฅ
If a transport receiver truncates messages, the truncation MUST occur at the end of the message. After truncation, the message MAY contain invalid UTF-8 encoding or invalid STRUCTURED-DATA. In that case the transport receiver MAY discard the message or MAY try to process as much as possible. Messy, but valid choices ๐
6.2. HEADER ๐งพ
The character set used in the HEADER MUST be seven-bit ASCII in an eight-bit field, as described in [RFC5234]. These are the ASCII codes defined in "USA Standard Code for Information Interchange" [ANSI.X3-4.1968]. Old-school energy, iconic ๐ผ
The header format is designed to provide some interoperability with older BSD-based syslog. For details on this, see Appendix A.1. Respect the elders ๐ซถ
6.2.1. PRI ๐ฏ
The PRI part MUST have three, four, or five characters, and it's bound with angle brackets as the first and last characters. The PRI part starts with a leading "<" ('less-than' character, %d60), followed by a number, which is then followed by a ">" ('greater-than' character, %d62). The number inside those angle brackets is the Priority value (PRIVAL), and it represents both the Facility and the Severity. The Priority value consists of one, two, or three decimal integers (ABNF DIGITS) using values of %d48 (for "0") through %d57 (for "9") โจ
Facility and Severity values are not normative but often used, so they're here purely for informational vibes ๐ The Facility table is below. Facility values MUST be in the range of 0 to 23 inclusive.
Numerical Facility
Code
0 kernel messages
1 user-level messages
2 mail system
3 system daemons
4 security/authorization messages
5 messages generated internally by syslogd
6 line printer subsystem
7 network news subsystem
8 UUCP subsystem
9 clock daemon
10 security/authorization messages
11 FTP daemon
12 NTP subsystem
13 log audit
14 log alert
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
Each message Priority also has a decimal Severity level indicator ๐จ The table is below, with the numerical values. Severity values MUST be in the range of 0 to 7 inclusive.
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 Severities
The Priority value is calculated by multiplying the Facility number by 8, then adding the numerical value of the Severity. For example, a kernel message (Facility=0) with a Severity of Emergency (Severity=0) would have a Priority value of 0. A "local use 4" message (Facility=20) with a Severity of Notice (Severity=5) would have a Priority value of 165 ๐งฎ In the PRI of a syslog message, those values go between the angle brackets as <0> and <165> respectively. The only time a value of "0" follows the "<" is for the Priority value of "0". Otherwise, leading "0"s MUST NOT be used. No padding, bestie, we don't do that here ๐ โโ๏ธ๐
6.2.2. VERSION ๐
VERSION tells you which version of the syslog protocol spec the message follows ๐
. The version number MUST be incremented for any new syslog protocol specification that changes any part of the HEADER format. Changes include the addition or removal of fields, or a change of syntax or semantics of existing fields. This document uses a VERSION value of 1. The VERSION values are IANA-assigned (Section 9.1) via the Standards Action method as described in [RFC5226].
6.2.3. TIMESTAMP โฐ
TIMESTAMP is a formalized timestamp derived from [RFC3339] ๐ฐ๏ธ
[RFC3339] allows a bunch of different syntaxes, but this document adds more rules on top, so it's way more locked in. The TIMESTAMP value MUST follow these restrictions:
- The "T" and "Z" characters in this syntax MUST be upper case.
- Usage of the "T" character is REQUIRED.
- Leap seconds MUST NOT be used.
The originator SHOULD include TIME-SECFRAC if its clock accuracy and performance permit. The "timeQuality" SD-ID described in Section 7.1 lets the originator say how accurate and trustworthy the timestamp is ๐ง
A syslog application MUST use the NILVALUE as TIMESTAMP if the syslog application is incapable of obtaining system time ๐ฅฒ
6.2.3.1. Examples ๐
Example 1
1985-04-12T23:20:50.52Z
This represents 20 minutes and 50.52 seconds after the 23rd hour of 12 April 1985 in UTC.
Example 2
1985-04-12T19:20:50.52-04:00
Same time as Example 1, just expressed in US Eastern Standard Time (observing daylight savings time) ๐ฝ
Example 3
2003-10-11T22:14:15.003Z
This represents 11 October 2003 at 10:14:15pm, 3 milliseconds into the next second. The timestamp is in UTC and gives millisecond resolution. The creator may have actually had better resolution, but three digits for the fractional part of a second doesn't tell us that ๐คทโโ๏ธ
Example 4
2003-08-24T05:14:15.000003-07:00
This represents 24 August 2003 at 05:14:15am, 3 microseconds into the next second. The microsecond resolution shows up in the extra digits in TIME-SECFRAC. The timestamp says its local time is -7 hours from UTC, so this one might've been made in the US Pacific time zone during daylight savings time ๐ด
Example 5 - An Invalid TIMESTAMP ๐ โโ๏ธ
2003-08-24T05:14:15.000000003-07:00
This is basically Example 4, but TIME-SECFRAC is in nanoseconds now. That makes TIME-SECFRAC longer than the allowed 6 digits, which invalidates it ๐
6.2.4. HOSTNAME ๐ฅ๏ธ
HOSTNAME identifies the machine that originally sent the syslog message ๐
The HOSTNAME field SHOULD contain the hostname and the domain name of the originator in the format specified in STD 13 [RFC1034]. This format is called a Fully Qualified Domain Name (FQDN) in this document ๐
Real talk, not every syslog application can give you an FQDN. So other values MAY also be present in HOSTNAME. This document has provisions for using other values in those situations. A syslog application SHOULD provide the most specific available value first. The order of preference for the contents of the HOSTNAME field is as follows:
- FQDN
- Static IP address
- hostname
- Dynamic IP address
- the NILVALUE
If an IPv4 address is used, it MUST be in the format of the dotted decimal notation as used in STD 13 [RFC1035]. If an IPv6 address is used, a valid textual representation as described in [RFC4291], Section 2.2, MUST be used ๐ข
Syslog applications SHOULD consistently use the same value in the HOSTNAME field for as long as possible. Consistency is everything, periodt ๐
The NILVALUE SHOULD only be used when the syslog application has no way to obtain its real hostname. This situation is considered highly unlikely ๐
6.2.5. APP-NAME ๐งฉ
The APP-NAME field SHOULD identify the device or application that originated the message. It's a string without further semantics, and it's meant for filtering messages on a relay or collector ๐
The NILVALUE MAY be used when the syslog application has no idea of its APP-NAME or cannot provide that information. A device might be unable to provide it because of a local policy decision, or because the information is not available, or not applicable, on the device ๐คซ
This field MAY be operator-assigned ๐ ๏ธ
6.2.6. PROCID ๐
PROCID is a value included in the message. It has no interoperable meaning, except that a change in the value indicates there has been a discontinuity in syslog reporting โจ The field doesn't have any specific syntax or semantics. The value is implementation-dependent and/or operator-assigned. The NILVALUE MAY be used when no value is provided.
PROCID is often used to provide the process name or process ID associated with a syslog system. The NILVALUE might be used when a process ID isn't available. On an embedded system with no operating system process ID, PROCID might be a reboot ID ๐
PROCID can help log analyzers spot discontinuities in syslog reporting, by noticing a change in the syslog process ID. BUT (and this is important) PROCID is not a reliable way to identify a restarted process, since the restarted syslog process might get the same process ID as the previous one ๐ฌ
PROCID can also be used to tell which messages belong to a group. For example, an SMTP mail transfer agent might put its SMTP transaction ID into PROCID, so the collector or relay can group messages by that SMTP transaction ๐ฌ
6.2.7. MSGID ๐ท๏ธ
The MSGID SHOULD identify the type of message. For example, a firewall might use the MSGID TCPIN for incoming TCP traffic and TCPOUT for outgoing TCP traffic. Messages with the same MSGID should reflect events of the same semantics. The MSGID itself is a string without further semantics. It's meant for filtering messages on a relay or collector ๐ง
The NILVALUE SHOULD be used when the syslog application does not, or cannot, provide any value.
This field MAY be operator-assigned.
6.3. STRUCTURED-DATA ๐๏ธ
STRUCTURED-DATA gives you a way to express information in a well defined, easily parseable and interpretable data format. There are lots of usage scenarios. For example, it can express meta-information about the syslog message, or application-specific info like traffic counters or IP addresses ๐
STRUCTURED-DATA can contain zero, one, or multiple structured data elements, which this document calls "SD-ELEMENT" ๐งฑ
If there are zero structured data elements, the STRUCTURED-DATA field MUST contain the NILVALUE.
The character set used in STRUCTURED-DATA MUST be seven-bit ASCII in an eight-bit field, as described in [RFC5234]. These are the ASCII codes defined in "USA Standard Code for Information Interchange" [ANSI.X3-4.1968]. The one exception is the PARAM-VALUE field (see Section 6.3.3), which MUST use UTF-8 encoding ๐
A collector MAY ignore malformed STRUCTURED-DATA elements. A relay MUST forward malformed STRUCTURED-DATA without any alteration ๐
6.3.1. SD-ELEMENT ๐งฌ
An SD-ELEMENT is made of a name and parameter name-value pairs. The name is called the SD-ID. The name-value pairs are called "SD-PARAM" ๐
6.3.2. SD-ID ๐ชช
SD-IDs are case-sensitive, and they uniquely identify the type and purpose of the SD-ELEMENT. The same SD-ID MUST NOT exist more than once in a message ๐ซ
There are two formats for SD-ID names:
- Names that do not contain an at-sign (
@, ABNF %d64) are reserved to be assigned by IETF Review as described in BCP26 [RFC5226]. Currently, these are the names defined in Section 7. Names of this format are only valid if they are first registered with the IANA. Registered names MUST NOT contain an at-sign (@, ABNF %d64), an equal-sign (=, ABNF %d61), a closing brace (], ABNF %d93), a quote-character (", ABNF %d34), whitespace, or control characters (ASCII code 127 and codes 32 or less). - Anyone can define additional SD-IDs using names in the format
name@<private enterprise number>, e.g.,ourSDID@32473. The format of the part before the at-sign is not specified. However, these names MUST be printable US-ASCII strings, and MUST NOT contain an at-sign (@, ABNF %d64), an equal-sign (=, ABNF %d61), a closing brace (], ABNF %d93), a quote-character (", ABNF %d34), whitespace, or control characters. The part after the at-sign MUST be a private enterprise number as specified in Section 7.2.2. Heads up: throughout this document the value 32473 is used for all private enterprise numbers, because IANA reserved it as an example number for documentation. Implementors will need to use their own private enterprise number for the enterpriseId parameter, and when creating locally extensible SD-ID names ๐ข
6.3.3. SD-PARAM ๐
Each SD-PARAM is made of a name, called PARAM-NAME, and a value, called PARAM-VALUE.
PARAM-NAME is case-sensitive. IANA controls all PARAM-NAMEs, except the ones in SD-IDs whose names contain an at-sign. The PARAM-NAME scope is within a specific SD-ID, so equally named PARAM-NAME values in two different SD-IDs are NOT the same thing (they're totally different, bestie) ๐ฏ
To support international characters, the PARAM-VALUE field MUST be encoded using UTF-8. A syslog application MAY issue any valid UTF-8 sequence. A syslog application MUST accept any valid UTF-8 sequence in the "shortest form". It MUST NOT fail if control characters are present in PARAM-VALUE. The syslog application MAY modify messages containing control characters (for example, by changing an octet with value 0 (USASCII NUL) to the four characters #000). For the reasons outlined in UNICODE TR36 [UNICODE-TR36], section 3.1, an originator MUST encode messages in the "shortest form", and a collector or relay MUST NOT interpret messages in the "non-shortest form" ๐
Inside PARAM-VALUE, the characters " (ABNF %d34), \ (ABNF %d92), and ] (ABNF %d93) MUST be escaped. This is necessary to avoid parsing errors. Escaping ] would not strictly be necessary, but it is REQUIRED by this specification to avoid syslog application implementation errors. Each of these three characters MUST be escaped as \", \\, and \] respectively. The backslash is used for control character escaping, for consistency with its use for escaping in other parts of the syslog message as well as in traditional syslog ๐ช
A backslash (\) followed by none of the three described characters is considered an invalid escape sequence. In this case, the backslash MUST be treated as a regular backslash and the following character as a regular character. Thus, the invalid sequence MUST not be altered ๐
An SD-PARAM MAY be repeated multiple times inside an SD-ELEMENT ๐
6.3.4. Change Control ๐
Once SD-IDs and PARAM-NAMEs are defined, the syntax and semantics of these objects MUST NOT be altered. If you want to change an existing object, a new SD-ID or PARAM-NAME MUST be created, and the old one stays unchanged. OPTIONAL PARAM-NAMEs MAY be added to an existing SD-ID ๐
6.3.5. Examples ๐
okay so every example in this bit only shows the structured data part of the message ๐ โจ they're meant to be read as one line, even though I've wrapped them across a few lines so they're easier to read ๐ฅน each one gets a little description after it.
Example 1 - Valid ๐
[exampleSDID@32473 iut="3" eventSource="Application"
eventID="1011"]
this is a structured data element with a non-IANA controlled SD-ID of type "exampleSDID@32473", and it has three parameters ๐ฆ
Example 2 - Valid ๐ธ
[exampleSDID@32473 iut="3" eventSource="Application"
eventID="1011"][examplePriority@32473 class="high"]
this is the same as Example 1, just with a second structured data element tacked on ๐ notice that the second element sits right up against the first one, with no SP between them ๐
Example 3 - Invalid ๐
[exampleSDID@32473 iut="3" eventSource="Application"
eventID="1011"] [examplePriority@32473 class="high"]
this is nearly Example 2, but there's a sneaky little mistake ๐ there's an SP character between the two structured data elements ("]SP["). this is invalid. it'll make the STRUCTURED-DATA field end after the first element, so the second element gets treated as part of the MSG field. not it ๐ญ
Example 4 - Invalid ๐ฅ
[ exampleSDID@32473 iut="3" eventSource="Application"
eventID="1011"][examplePriority@32473 class="high"]
this one is also nearly Example 2, with another subtle slip ๐ the SP character shows up right after the opening bracket. a structured data element SD-ID MUST immediately follow the beginning bracket, so that SP wrecks the whole STRUCTURED-DATA. a syslog application MAY discard this message. bestie, don't be this one ๐
Example 5 - Valid ๐
[sigSig ver="1" rsID="1234" ... signature="..."]
Example 5 is valid โจ it shows a hypothetical IANA-assigned SD-ID. the ellipses stand in for content that's been left out for brevity ๐ง
6.4. MSG ๐
the MSG part is the free-form message that tells you what happened ๐
the character set used in MSG SHOULD be UNICODE, encoded with UTF-8 as specified in [RFC3629]. if the syslog application can't encode the MSG in Unicode, it MAY use any other encoding ๐ธ
the syslog application SHOULD avoid octet values below 32 (that's the traditional US-ASCII control character range, except DEL) ๐ those values are legal, but a syslog application MAY modify these characters upon reception. for example, it might turn them into an escape sequence, like changing value 0 into "\0". a syslog application SHOULD NOT modify any other octet values ๐ซถ
if a syslog application encodes MSG in UTF-8, the string MUST start with the Unicode byte order mask (BOM). for UTF-8 that's the ABNF %xEF.BB.BF. the syslog application MUST encode in the "shortest form" and MAY use any valid UTF-8 sequence ๐ฅ
if a syslog application is processing an MSG that starts with a BOM and the MSG contains UTF-8 that is not in shortest form, the MSG MUST NOT be interpreted as UTF-8, for the reasons laid out in [UNICODE-TR36], Section 3.1. there's guidance about this in Appendix A.8 ๐
also, according to UNICODE TR36 [UNICODE-TR36], a syslog application MUST NOT interpret messages in the "non-shortest form". it MUST NOT interpret invalid UTF-8 sequences either ๐
6.5. Examples ๐ฆ
the following are examples of valid syslog messages โจ each one has a description right under it. they're based on similar examples from [RFC3164], so you might recognise them ๐ the BOM is basically unprintable Unicode, so the examples write it out as "BOM" ๐
Example 1 - with no STRUCTURED-DATA ๐
<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47
- BOM'su root' failed for lonvick on /dev/pts/8
in this one the VERSION is 1 and the Facility is 4 ๐ธ the Severity is 2. the message was created on 11 October 2003 at 10:14:15pm UTC, 3 milliseconds into the next second โญ it came from a host that calls itself "mymachine.example.com". the APP-NAME is "su" and the PROCID is unknown. the MSGID is "ID47". the MSG is "'su root' failed for lonvick...", encoded in UTF-8, and the BOM is what tells you that encoding ๐ซถ there's no STRUCTURED-DATA here, which is why the STRUCTURED-DATA field just says "-".
Example 2 - with no STRUCTURED-DATA ๐ง
<165>1 2003-08-24T05:14:15.000003-07:00 192.0.2.1
myproc 8710 - - %% It's time to make the do-nuts.
the VERSION is 1 again ๐ the Facility is 20 and the Severity is 5. this was created on 24 August 2003 at 5:14:15am, with a -7 hour offset from UTC, 3 microseconds into the next second ๐ the HOSTNAME is "192.0.2.1", which means the syslog application didn't know its FQDN, so it used one of its IPv4 addresses instead ๐ the APP-NAME is "myproc" and the PROCID is "8710" (this could be the UNIX PID, for example). no STRUCTURED-DATA again, shown by the "-" in that field. and there's no specific MSGID, so that's the "-" in the MSGID field.
the message is "%% It's time to make the do-nuts." since the Unicode BOM is missing, the syslog application has no idea what encoding the MSG part is in ๐คทโโ๏ธ
Example 3 - with STRUCTURED-DATA ๐
<165>1 2003-10-11T22:14:15.003Z mymachine.example.com
evntslog - ID47 [exampleSDID@32473 iut="3" eventSource=
"Application" eventID="1011"] BOMAn application
event log entry...
this one is modelled on Example 1, but this time it has STRUCTURED-DATA: a single element with the value [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"] ๐
the MSG itself is "An application event log entry...". the BOM at the start of MSG tells you it's UTF-8 โจ
Example 4 - STRUCTURED-DATA Only ๐
<165>1 2003-10-11T22:14:15.003Z mymachine.example.com
evntslog - ID47 [exampleSDID@32473 iut="3" eventSource=
"Application" eventID="1011"][examplePriority@32473
class="high"]
this one has only STRUCTURED-DATA and no MSG part at all ๐ซถ and yes, it's a valid message, so no drama ๐ฆ
7. Structured Data IDs โจ
this section defines the initial IANA-registered SD-IDs ๐ if you need a refresher on what structured data elements are, see Section 6.3. every SD-ID defined here is OPTIONAL ๐
a few of the parameters below have a maximum length. for each of those, the syslog application MUST be prepared to receive that many characters in any valid UTF-8 code point. since each character can be up to 6 octets, it is RECOMMENDED that each syslog application be prepared to receive up to 6 octets per character ๐ง (so yes, be generous, bestie)
7.1. timeQuality โฐ
the SD-ID "timeQuality" MAY be used by the originator to describe its notion of system time ๐ธ this SD-ID SHOULD be written if the originator isn't properly synchronized with a reliable external time source, or if it doesn't know whether its time zone information is correct ๐ the main point of this element is to tell you how much trust you can put in the TIMESTAMP described in Section 6.2.3. all parameters are OPTIONAL ๐
7.1.1. tzKnown ๐
the "tzKnown" parameter says whether the originator knows its time zone ๐ if it does, the value "1" MUST be used. if the time zone information is in doubt, the value "0" MUST be used. and if the originator knows its time zone but decides to emit time in UTC anyway, the value "1" MUST be used, because the time zone is known โจ
7.1.2. isSynced ๐
the "isSynced" parameter says whether the originator is synchronized to a reliable external time source, like via NTP ๐ฐ๏ธ if the originator is time synchronized, the value "1" MUST be used. if not, the value "0" MUST be used ๐ซถ
7.1.3. syncAccuracy ๐ฏ
the "syncAccuracy" parameter says how accurate the originator thinks its time sync is ๐ฆ it's an integer for the maximum number of microseconds its clock may be off between sync intervals.
if "0" is used for "isSynced", this parameter MUST NOT be specified ๐ โโ๏ธ if "1" is used for "isSynced" but "syncAccuracy" is absent, a collector or relay can assume the time info is accurate enough to be considered correct ๐ the "syncAccuracy" parameter MUST be written only if the originator actually knows how reliable its external time source is. most of the time, it'll learn that through operator configuration ๐ง
7.1.4. Examples ๐
the following is an example of an originator that doesn't know its time zone or whether it's being synchronized:
[timeQuality tzKnown="0" isSynced="0"]
so the originator is basically saying its time info is unreliable ๐ญ that can be a hint for the collector or relay to use its own local time instead of the TIMESTAMP in the message when it correlates messages from different originators ๐
the following is an example of an originator that knows its time zone and knows it's properly synced to a reliable external source:
[timeQuality tzKnown="1" isSynced="1"]
and this one is an originator that knows both its time zone and that it's externally synchronized, plus how accurate that sync is ๐คฉ
[timeQuality tzKnown="1" isSynced="1" syncAccuracy="60000000"]
the difference from the previous example is that this originator expects its clock to stay within 60 seconds of the official time ๐ so if it reports 9:00:00, it's no earlier than 8:59:00 and no later than 9:01:00 โญ
7.2. origin ๐ท
the SD-ID "origin" MAY be used to show where a syslog message came from ๐ง these parameters can be used, and all of them are OPTIONAL ๐
specifying any of these is mainly a help for log analyzers and similar apps ๐
7.2.1. ip ๐
the "ip" parameter is an IP address that the originator knows it had at the time it sent the message. it MUST contain the textual representation of an IP address as outlined in Section 6.2.4 ๐
this parameter can add identifying info on top of what's in the HOSTNAME field. it can be especially handy when the IP address is in the message but the HOSTNAME field still has the FQDN ๐ซถ it's also useful for describing all the IP addresses of a multihomed host ๐
if an originator has multiple IP addresses, it MAY either list just one of them in the "ip" parameter, or it MAY include multiple "ip" parameters in a single "origin" structured data element ๐
7.2.2. enterpriseId โจ
The "enterpriseId" parameter MUST be a 'SMI Network Management Private Enterprise Code' ๐, maintained by IANA, whose prefix is iso.org.dod.internet.private.enterprise (1.3.6.1.4.1). Okay so the number that follows MUST be unique and MUST be registered with IANA as per RFC 2578 [RFC2578] ๐
. An enterprise is only authorized to assign values within the iso.org.dod.internet.private.enterprise.<private enterprise number> subtree assigned by IANA to that enterprise ๐ฆ. The enterpriseId MUST contain only a value from the iso.org.dod.internet.private.enterprise.<private enterprise number> subtree ๐ฅ. In general, only the IANA-assigned private enterprise number is needed (a single number) ๐ธ. An enterprise might decide to use sub-identifiers below its private enterprise number ๐. If sub-identifiers are used, they MUST be separated by periods and be represented as decimal numbers ๐ง. An example for that would be "32473.1.2" โจ. Please note that the ID "32473.1.2" is just an example and MUST NOT be used ๐. The complete up-to-date list of Private Enterprise Numbers (PEN) is maintained by IANA ๐.
By specifying a private enterprise number, the vendor allows more specific processing of the message ๐ซถ.
7.2.3. software โจ
The "software" parameter uniquely identifies the software that generated the message ๐. If it is used, "enterpriseId" SHOULD also be specified, so that a specific vendor's software can be identified ๐. The "software" parameter is not the same as the APP-NAME header field ๐. It MUST always contain the name of the generating software, whereas APP-NAME can contain anything else, including an operator-configured value ๐ .
The "software" parameter is a string. It MUST NOT be longer than 48 characters ๐.
7.2.4. swVersion โจ
The "swVersion" parameter uniquely identifies the version of the software that generated the message ๐ฆ. If it is used, the "software" and "enterpriseId" parameters SHOULD be provided, too ๐ธ.
The "swVersion" parameter is a string. It MUST NOT be longer than 32 characters ๐.
7.2.5. Example ๐
The following is an example with multiple IP addresses:
[origin ip="192.0.2.1" ip="192.0.2.129"]
In this example, the originator indicates that it has two IP addresses, one being 192.0.2.1 and the other one being 192.0.2.129 ๐ซถ.
7.3. meta ๐ง
The SD-ID "meta" MAY be used to provide meta-information about the message ๐. The following parameters can be used. All parameters are OPTIONAL. If the "meta" SD-ID is used, at least one parameter SHOULD be specified ๐.
7.3.1. sequenceId โจ
The "sequenceId" parameter tracks the sequence in which the originator submits messages to the syslog transport for sending ๐ฆ. It is an integer that MUST be set to 1 when the syslog function is started and MUST be increased with every message up to a maximum value of 2147483647 ๐. If that value is reached, the next message MUST be sent with a sequenceId of 1 ๐ .
7.3.2. sysUpTime โจ
The "sysUpTime" parameter MAY be used to include the SNMP "sysUpTime" parameter in the message ๐ธ. Its syntax and semantics are as defined in [RFC3418] ๐.
As syslog does not support the SNMP "INTEGER" syntax directly, the value MUST be represented as a decimal integer (no decimal point) using only the characters "0", "1", "2", "3", "4", "5", "6", "7", "8", and "9" ๐ฅ.
Note that the semantics in RFC 3418 are "The time (in hundredths of a second) since the network management portion of the system was last re-initialized." ๐ This of course relates to the SNMP-related management portion of the system, which MAY be different than the syslog-related management portion of the system ๐.
7.3.3. language โจ
The "language" parameter MAY be specified by the originator to convey information about the natural language used inside MSG ๐. If it is specified, it MUST contain a language identifier as defined in BCP 47 [RFC4646] ๐ซถ.
- Security Considerations ๐ฅ
8.1. UNICODE ๐
This document uses UTF-8 encoding for the PARAM-VALUE and MSG fields ๐ฆ. There are a number of security issues with UNICODE. Any implementer and operator is advised to review UNICODE TR36 [UNICODE-TR36] (UTR36) to learn about these issues ๐. This document guards against the technical issues outlined in UTR36 by REQUIRING "shortest form" encoding for syslog applications ๐ . However, the visual spoofing due to character confusion still persists ๐ญ. This document tries to minimize the effects of visual spoofing by allowing UNICODE only where local script is expected and needed ๐ธ. In all other fields, US-ASCII is REQUIRED ๐. Also, the PARAM-VALUE and MSG fields should not be the primary source for identifying information, further reducing the risks associated with visual spoofing ๐.
8.2. Control Characters ๐
This document does not impose any mandatory restrictions on the MSG or PARAM-VALUE content ๐. As such, they MAY contain control characters, including the NUL character ๐ง.
In some programming languages (most notably C and C++), the NUL character (ABNF %d00) traditionally has a special significance as string terminator ๐ฅ. Most implementations of these languages assume that a string will not extend beyond the first NUL character ๐. This is primarily a restriction of the supporting run-time libraries ๐. This restriction is often carried over to programs and script languages written in those languages ๐ซถ. As such, NUL characters must be considered with great care and be properly handled ๐ญ. An attacker may deliberately include NUL characters to hide information after them ๐. Incorrect handling of the NUL character may also invalidate cryptographic checksums that are transmitted inside the message ๐ฆ.
Many popular text editors are also written in languages with this restriction ๐ . Encoding NUL characters when writing to text files is advisable ๐. If they are stored without encoding, the file can become unreadable ๐.
Other control characters may also be problematic ๐ธ. For example, an attacker may deliberately include backspace characters to render parts of the log message unreadable ๐. Similar issues exist for almost all control characters ๐ฅ.
Finally, invalid UTF-8 sequences may be used by an attacker to inject ASCII control characters ๐.
This specification permits a syslog application to reformat control characters received ๐. Among others, the security risks associated with control characters were an important driving force behind this restriction ๐. Originators are advised that if any encoding other than ASCII and UTF8 are used, the receiver may corrupt the message in an attempt to filter ASCII control characters ๐ซถ.
8.3. Message Truncation ๐
Message truncation can be misused by an attacker to hide vital log information ๐ญ. Messages over the minimum supported size may be discarded or truncated by the transport receiver ๐ฆ. As such, vital log information may be lost ๐ .
In order to prevent information loss, messages should not be longer than the minimum maximum size required by Section 6.1 ๐ธ. For best performance and reliability, messages should be as small as possible ๐. Important information should be placed as early in the message as possible because information at the beginning of the message is less likely to be discarded by a size-limited transport receiver ๐ง.
An originator should limit the size of any user-supplied data within a syslog message ๐. If it does not, an attacker may provide large data in hopes of exploiting a potential weakness ๐ฅ.
8.4. Replay ๐
There is no mechanism in the syslog protocol to detect message replay ๐. An attacker may record a set of messages that indicate normal activity of a machine ๐ฆ. At a later time, that attacker may remove that machine from the network and replay the syslog messages to the relay or collector ๐. Even with the TIMESTAMP field in the HEADER part, an attacker may record the packets and could simply modify them to reflect the current time before retransmitting them ๐ . The administrators may find nothing unusual in the received messages, and their receipt would falsely indicate normal activity of the machine ๐ญ.
Cryptographically signing messages could prevent the alteration of TIMESTAMPs and thus the replay attack ๐.
8.5. Reliable Delivery ๐
Because there is no mechanism described within this document to ensure delivery, and the underlying transport may be unreliable (e.g., UDP), some messages may be lost ๐ญ. They may either be dropped through network congestion, or they may be maliciously intercepted and discarded ๐ฆ. The consequences of dropping one or more syslog messages cannot be determined ๐. If the messages are simple status updates, then their non-receipt may not be noticed or may cause an annoyance for the system operators ๐ . On the other hand, if the messages are more critical, then the administrators may not become aware of a developing and potentially serious problem ๐. Messages may also be intercepted and discarded by an attacker as a way to hide unauthorized activities ๐ฅ.
It may also be desirable to include rate-limiting features in syslog originators and relays ๐ธ. This can reduce potential congestion problems when message bursts happen ๐.
Reliable delivery may not always be desirable ๐ง. Reliable delivery means that the syslog originator or relay must block when the relay or collector is not able to accept any more messages ๐. In some operating systems, namely Unix/Linux, the syslog originator or relay runs inside a high-priority system process (syslogd) ๐. If that process blocks, the system at large comes to a stand-still ๐ญ. The same occurs if there is a deadlock situation between syslogd and e.g., the DNS server ๐.
To prevent these problems, reliable delivery can be implemented in a way that intentionally discards messages when the syslog application would otherwise block ๐. The advantage of reliable delivery in this case is that the syslog originator or relay knowingly discards the message and is able to notify the relay or collector about that fact ๐ซถ. So the relay or collector receives the information that something is lost ๐ฆ. With unreliable delivery, the message would simply be lost without any indication that loss occurred ๐.
8.6. Congestion Control ๐ฆ
okay so bestie, syslog can spit out an unlimited amount of data ๐ญ, and sending that over UDP is lowkey a problem because UDP has no congestion control ๐. Congestion control is the stuff that slows traffic down when the network is struggling and keeps flows fair with each other on the same path, and it's vital for the Internet to stay stable ๐ซถ [RFC2914]. That's why the syslog TLS transport is REQUIRED to implement ๐ฅ and RECOMMENDED for general use ๐.
The only places the syslog UDP transport MAY be used as an alternative to TLS are managed networks โจ, where the path has been explicitly set up for UDP syslog traffic with traffic engineering stuff like rate limiting or capacity reservations ๐. Everywhere else, the TLS transport SHOULD be used ๐ .
Any implementation can end up in a spot where an originator or relay has to block sending messages ๐. A super common case is when an internal queue is full, which can happen because of rate-limiting or because the syslog app is slow ๐ข. Either way, it is highly RECOMMENDED that no messages get dropped, and that they get temporarily stored until they can be sent ๐ธ. But if they really must be dropped, it is RECOMMENDED that the originator or relay drops the lower severity ones first and keeps the higher severity ones ๐.
Messages with a lower numerical SEVERITY value have a higher practical severity than ones with a higher number, so that's the situation where the messages that are going to be dropped SHOULD simply be discarded ๐๏ธ. The syslog app may notify a collector or relay that it dropped messages ๐.
8.7. Message Integrity ๐
Besides getting discarded, syslog messages can get damaged in transit ๐ฌ, or an attacker might maliciously modify them ๐ฟ. In those cases, the original contents of the message will not be delivered to the collector or relay ๐ซ. Also, if an attacker is sitting between the transport sender and transport receiver, they may be able to intercept and modify messages while they're in transit to hide unauthorized activities ๐ต๏ธโโ๏ธ.
8.8. Message Observation ๐
So there are no strict guidelines for the MSG format ๐คทโโ๏ธ, but most syslog messages are made to be human-readable, with the assumption that capable admins should be able to read them and understand what they mean ๐. The syslog protocol does not have mechanisms to provide confidentiality for messages in transit ๐ โโ๏ธ. In most cases, clear-text messages are actually a benefit to the ops staff if they're sniffing packets off the wire ๐ฆ. They can read the messages and connect them with other events from other packets crossing the wire, which helps them track down and fix problems ๐ง. Unfortunately, an attacker may also be able to observe the human-readable contents of syslog messages ๐ฑ. They can use what they learn from those messages to compromise a machine or do other damage ๐.
Operators are advised to use a secure transport mapping to avoid this problem ๐.
8.9. Inappropriate Configuration ๐
Because there is no control information distributed about any messages or configurations, it is totally the responsibility of the network administrator to make sure messages are actually going to the intended recipients ๐ฌ. Cases have been noted where syslog apps were accidentally configured to send messages to the wrong relays or collectors ๐ต. In many cases, those accidental relays or collectors aren't set up to receive syslog messages and will probably just discard them ๐๏ธ. In certain other cases, receiving syslog messages has been known to cause problems for the unintended recipient ๐ญ. If messages aren't reaching the intended recipient, then they can't be reviewed or processed ๐ฅฒ.
Using a reliable transport mapping can help catch some of these problems โ . For example, it can spot a message being sent to a system that isn't configured to receive messages ๐. It cannot spot sending messages to a wrong machine that is accepting messages ๐.
8.10. Forwarding Loop ๐
As shown in Diagram 2, machines may be configured to relay syslog messages to later relays before they reach a collector ๐ง. In one particular case, an admin found that he had mistakenly configured two relays to forward messages with certain SEVERITY values to each other ๐. Whenever either of these machines received or generated that type of message, it would forward it to the other relay, and that relay would forward it right back ๐. This cycle did cause degradation to the surrounding network as well as to the processing availability on the two devices ๐. Network administrators must take care not to cause such a death spiral โ ๏ธ.
8.11. Load Considerations ๐๏ธโโ๏ธ
Network administrators must take the time to estimate the right capacity for the syslog collector ๐. An attacker may perform a Denial of Service attack by filling the collector's disk with false messages ๐. Putting the records in a circular file may help with this ๐, but then there's no guarantee that an admin will be able to review the records later ๐ฌ. Along those lines, a transport receiver must have a network interface that's capable of receiving the messages sent to it ๐ก.
Administrators and network planners must also critically review the network paths between the originators, the relays, and the collectors ๐บ๏ธ. Generated syslog messages should not overwhelm any of the network links ๐ง.
To reduce the impact of this issue, using transports with guaranteed delivery is recommended ๐.
8.12. Denial of Service ๐ฉ๏ธ
As with any system, an attacker may just overwhelm a transport receiver by sending it more messages than the infrastructure or the device itself can handle ๐ฅ. Implementers should try to provide features that minimize this threat ๐ก๏ธ, such as only accepting syslog messages from known IP addresses ๐ฏ.
- IANA Considerations ๐ธ
9.1. VERSION ๐ข
IANA has created a registry called "syslog Version Values" for VERSION values, as described in Section 6.2.2 ๐. Version numbers MUST be incremented for any new syslog protocol specification that changes any part of the HEADER โฌ๏ธ. Changes include adding or removing fields, or changing the syntax or semantics of existing fields ๐ง.
VERSION numbers must be registered via the Standards Action method, as described in [RFC5226] ๐. IANA has registered the VERSIONs shown in Table 3 below ๐.
VERSION FORMAT
1 Defined in [RFC5424]
Table 3. IANA-Registered VERSIONs
9.2. SD-IDs ๐
IANA has created a registry called "syslog Structured Data ID Values" for Structured Data ID (SD-ID) values, together with their associated PARAM-NAME values, as described in Section 7 ๐๏ธ.
New SD-ID and new PARAM-NAME values must be registered through the IETF Review method, as described in [RFC5226] ๐.
Once SD-IDs and SD-PARAMs are defined, their syntax and semantics MUST NOT be altered ๐ซ. Should a change to an existing object be desired, a new SD-ID or SD-PARAM MUST be created and the old one MUST remain unchanged ๐ซก.
There's a provision here for locally extensible names ๐ . The IANA will not register, and will not control, names with the at-sign (ABNF %d64) in them ๐.
IANA has registered the SD-IDs and PARAM-NAMEs shown in Table 4 below ๐.
SD-ID PARAM-NAME
timeQuality OPTIONAL
tzKnown OPTIONAL
isSynced OPTIONAL
syncAccuracy OPTIONAL
origin OPTIONAL
ip OPTIONAL
enterpriseId OPTIONAL
software OPTIONAL
swVersion OPTIONAL
meta OPTIONAL
sequenceId OPTIONAL
sysUpTime OPTIONAL
language OPTIONAL
Table 4. IANA-Registered SD-IDs and their PARAM-NAMEs
- Working Group ๐ฏโโ๏ธ
The working group can be contacted via the mailing list ๐:
syslog@ietf.org
The current Chairs of the Working Group may be contacted at ๐ง:
Chris Lonvick
Cisco Systems
EMail: clonvick@cisco.com
David Harrington
Huawei Technologies USA
EMail: dbharrington@comcast.net
- Acknowledgments ๐ซถ
The authors wish to thank Chris Lonvick, Jon Callas, Andrew Ross, Albert Mietus, Anton Okmianski, Tina Bird, Devin Kowatch, David Harrington, Sharon Chisholm, Richard Graveman, Tom Petch, Dado Colussi, Clement Mathieu, Didier Dalmasso, and all the other people who commented on various versions of this proposal ๐.
- References ๐
12.1. Normative References ๐ฆ
[ANSI.X3-4.1968] American National Standards Institute, "USA Code
for Information Interchange", ANSI X3.4, 1968.
[RFC1034] Mockapetris, P., "Domain names - concepts and
facilities", STD 13, RFC 1034, November 1987.
[RFC1035] Mockapetris, P., "Domain names - implementation and
specification", STD 13, RFC 1035, November 1987.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2578] McCloghrie, K., Ed., Perkins, D., Ed., and J.
Schoenwaelder, Ed., "Structure of Management
Information Version 2 (SMIv2)", STD 58, RFC 2578,
April 1999.
[RFC2914] Floyd, S., "Congestion Control Principles", BCP 41,
RFC 2914, September 2000.
[RFC3339] Klyne, G., Ed. and C. Newman, "Date and Time on the
Internet: Timestamps", RFC 3339, July 2002.
[RFC3418] Presuhn, R., "Management Information Base (MIB) for
the Simple Network Management Protocol (SNMP)",
STD 62, RFC 3418, December 2002.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
10646", STD 63, RFC 3629, November 2003.
[RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing
Architecture", RFC 4291, February 2006.
[RFC4646] Phillips, A. and M. Davis, "Tags for Identifying
Languages", BCP 47, RFC 4646, September 2006.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for
Writing an IANA Considerations Section in RFCs",
BCP 26, RFC 5226, May 2008.
[RFC5234] Crocker, D. and P. Overell, "Augmented BNF for
Syntax Specifications: ABNF", STD 68, RFC 5234,
January 2008.
[RFC5425] Fuyou, M., Yuzhi, M., and J. Salowey, "TLS
Transport Mapping for Syslog", RFC 5425, March
2009.
[RFC5426] Okmianski, A., "Transmission of Syslog Messages
over UDP", RFC 5426, March 2009.
[UNICODE-TR36] Davis, M. and M. Suignard, "UNICODE Security
Considerations", July 2005.
12.2. Informative References ๐ง
[RFC3164] Lonvick, C., "The BSD Syslog Protocol", RFC 3164,
August 2001.
Appendix A. Implementer Guidelines โจ
okay so this whole section is extra advice to help implementers out ๐ it's not normative, which means you are NOT REQUIRED to follow any of it to claim compliance with this spec. vibes only, no pressure ๐ซถ
A.1. Relationship with BSD Syslog ๐ฆ
okay so BSD syslog is literally everywhere, but its format was never formally standardized ๐ [RFC3164] describes the formats people actually observed in the wild. It's an Informational RFC, and there are tons of different implementations out there. The research done while this document was being written showed that different syslog implementations on different platforms have very little in common. The only thing they all agree on is that messages start with "<" PRIVAL ">". Beyond that, legacy syslog messages are not formatted in a consistent way, so RFC 3164 describes no specific elements inside a syslog message. It says that any message sent to the syslog UDP port must be treated as a syslog message, no matter what its format or content is. chaotic but iconic ๐
This document keeps the PRI value syntax and semantics ๐ which lets legacy syslog implementations sort messages generated by syslog applications that comply with this specification into the right bins. bestie-approved bridge energy ๐
Most existing implementations use UDP as the transport protocol for syslog. This specification supports UDP transport but does not recommend it ๐ Deployment of the required TLS support is recommended. Additional transport protocols may be used โจ
RFC 3164 describes relay behavior. This document does not specify relay behavior. That might be done in a separate document ๐ง
The TIMESTAMP described in RFC 3164 is less precise than the timestamp in this document, and it also lacks the year and time zone information ๐ญ If a message formatted according to this document needs to be reformatted into RFC 3164 format, it is suggested that the originator's local time zone be used, and the time zone information and the year be dropped. If an RFC 3164 formatted message is received and must be transformed to comply with this document, the current year should be added, and the time zone of the relay or collector MAY be used ๐
The HOSTNAME in RFC 3164 is less specific, but this format is still supported in this document as one of the alternate HOSTNAME representations ๐
The MSG part of the message is described as TAG and CONTENT in RFC 3164. In this document, MSG is what was called CONTENT in RFC 3164. The TAG is now part of the header, but not as a single field. It has been split into APP-NAME, PROCID, and MSGID. This doesn't totally look like the old TAG usage, but it gives the same functionality for most cases ๐
In RFC 3164, STRUCTURED-DATA was not described. If a message that complies with this document contains STRUCTURED-DATA and must be reformatted according to RFC 3164, the STRUCTURED-DATA simply becomes part of the RFC 3164 CONTENT free-form text ๐ธ
Overall, this document tries to give you an easily parseable header with clear field separations ๐ whereas traditional BSD syslog suffers from some historically developed, hard-to-parse field separation rules. parsing nightmare, be gone ๐
A.2. Message Length ๐
okay so implementers should note the message size limitations in Section 6.1 and try to keep the most important data early in the message (within the minimum guaranteed length) ๐ฅ That way the data still gets seen by the collector or relay even if a transport receiver at a relay on the message path truncates the message.
Syslog transport receivers need only support receiving up to and including 480 octets, and that has a lot to do with delivery problems in a broken network ๐ฉ Syslog messages may use a UDP transport mapping with this 480 octet restriction to avoid session overhead and message fragmentation. On a network with problems, one single-packet message is more likely to get delivered successfully than two message fragments are. So a larger size may stop the operator from getting critical info about the problem, while small messages might actually get that info through ๐ฅบ It is recommended that messages intended for troubleshooting not be larger than 480 octets. To back this up, some UDP implementations generally don't support message sizes over 480 octets. This is very rare and may no longer be an issue ๐ค
Other use cases send inherently lengthy information, for example audit data ๐ By not enforcing any upper limit on message size, syslog applications can be built with whatever size they need and still comply with this document. In those cases, it is the operator's responsibility to make sure every component in the syslog infrastructure supports the required message sizes. Transport mappings may recommend specific message size limits that must be implemented to comply.
Reminder: message length is specified in octets ๐งฎ There can be a big difference between the length in characters and the length in octets for UTF-8 strings. the classic gotcha ๐
It must be noted that the IPv6 MTU is about 2.5 times 480. An implementation aimed at an IPv6-only environment might therefore assume this as a larger minimum size ๐
A.3. Severity Values ๐จ
This section gives guidelines for using Severity as outlined in Section 6.2.1 โจ
All implementations should try to assign the most appropriate severity to their message ๐ Most importantly, messages designed to help debug or test software should be assigned Severity 7. Severity 0 should be reserved for messages of very high importance, like serious hardware failures or an imminent power failure ๐ฅ An implementation may use Severities 0 and 7 for other purposes if the administrator configures it to.
Severities are very subjective, so a relay or collector should not assume that all originators share the same definition of severity ๐คทโโ๏ธ
A.4. TIME-SECFRAC Precision โฑ๏ธ
The TIMESTAMP described in Section 6.2.3 supports fractional seconds. This sets up a super common coding error ๐ญ where leading zeros get removed from the fractional seconds. For example, the TIMESTAMP "2003-10-11T22:13:14.003" may be erroneously written as "2003-10-11T22:13:14.3". That would mean 300 milliseconds instead of the 3 milliseconds that were actually meant. the tiniest zero, the biggest chaos ๐
A.5. Case Convention for Names ๐ช
Names show up in various places in this document, for example for SD-IDs and PARAM-NAMEs. This document uses "lower camel case" consistently ๐ท That means each name begins with a lower case letter, and each new embedded word starts with an upper case letter, with no hyphen or other delimiter. An example is "timeQuality". so clean ๐ซง
An implementation is free to use any other case convention for experimental names, but it is suggested that the case convention outlined above is followed ๐
A.6. Syslog Applications Without Knowledge of Time โฐ
In Section 6.2.3, the NILVALUE has been allowed for use by originators without knowledge of time ๐ This covers a special case where a syslog application isn't aware of time at all. Honestly, it can be argued whether such an application can actually be found in today's IT infrastructure ๐ค However, discussion indicated that these things may exist in practice, so there should be a guideline established for this case.
That said, an implementation SHOULD emit a valid TIMESTAMP if the underlying operating system, programming system, and hardware support a clock function โญ A proper TIMESTAMP should be emitted even if it's difficult to obtain the system time. The NILVALUE should only be used when it is actually impossible to obtain time information. This rule should not be used as an excuse for lazy implementations ๐
A.7. Notes on the timeQuality SD-ID ๐ฐ๏ธ
It is recommended that the value "0" be the default for the "tzKnown" (Section 7.1.1) parameter. It should only be changed to "1" after the administrator has specifically configured the time zone. The value "1" may be used as the default if the underlying operating system provides accurate time zone information. Even so, it is still advised that the administrator consider how correct the time zone information is ๐ง
It's important not to create a false impression of accuracy with the timeQuality SD-ID (Section 7.1) ๐ซ An originator should only indicate a given accuracy if it actually knows it is within those bounds. It is generally assumed that the originator gains this in-depth knowledge through operator configuration. By default, an accuracy should not be provided. don't fake your confidence, bestie ๐
A.8. UTF-8 Encoding and the BOM ๐
This document specifies that SD-PARAMS must always be encoded in UTF-8 ๐ Other encodings of the message in the MSG portion, including ASCIIPRINT, are not permitted by a device conforming to this specification. There are two cases to address here ๐ซถ
First, a syslog application conforming to this specification may not be able to determine that the information it gets from an originator is encoded in UTF-8. If it can't determine that with certainty, the syslog application may choose not to include the BOM in the MSG. If the syslog application has a good indication that the message content is encoded in UTF-8, then it should include the BOM โจ
Second, a syslog relay may be forwarding a message from a device that does not conform to this specification. In that case, the device would likely not include the BOM unless it has ascertained that the received message was encoded in UTF-8 ๐ธ
Author's Address ๐
Rainer Gerhards
Adiscon GmbH
Mozartstrasse 21
Grossrinderfeld, BW 97950
Germany
EMail: rgerhards@adiscon.com
๐ฆ where this page comes from
- ietf: rfc5424 2009-03
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms