Syslog carries most of the security telemetry from network devices, Linux hosts and appliances, yet many pipelines still parse it as if every sender spoke the same dialect, so timestamps, hostnames and severities are quietly wrong by the time they reach the SIEM. Two documents define what a syslog message looks like: RFC 3164, which recorded how BSD syslog behaved in practice, and RFC 5424, the Standards Track protocol that replaced it. This guide explains the differences field by field, the facility and severity codes, RFC 5424 structured data, and the transport and signing options that protect messages in transit. It is for SOC and logging engineers. For device-side collection and detections, see the Network Device Syslog and Configuration Change Detection Guide.
Key takeaways
- RFC 3164 describes, RFC 5424 specifies. RFC 3164 (Informational, August 2001) documents observed behaviour; RFC 5424 (Standards Track, March 2009) obsoletes it and defines a strict, versioned header.
- The PRI value encodes two fields. Priority equals facility times 8 plus severity, giving values 0 to 191, so
<165>means local4 (20) at Notice (5). - Old timestamps lose the year and time zone. RFC 3164 uses local time in
Mmm dd hh:mm:ss; RFC 5424 requires RFC 3339 timestamps with an explicit offset and up to microsecond precision. - Structured data makes syslog machine-readable. RFC 5424 adds SD-ELEMENTs such as
timeQuality,originandmeta, plus private elements named with an IANA enterprise number. - Plain syslog is unauthenticated. UDP 514 and plain TCP offer no integrity or confidentiality; use TLS on TCP 6514 (RFC 5425, cipher suites updated by RFC 9662) and consider signed syslog (RFC 5848) where log integrity must survive relays.
Syslog history
Syslog grew out of BSD Unix and spread to network devices and appliances long before it was written down, which is why RFC 3164 says it describes observed behaviour rather than defining a protocol. The syslog working group then separated format from transport in a set of Standards Track documents:
| Document | Status | Date | What it defines |
|---|---|---|---|
| RFC 3164 The BSD syslog Protocol | Informational (obsoleted by RFC 5424) | August 2001 | Observed legacy format: PRI, HEADER (TIMESTAMP, HOSTNAME), MSG (TAG, CONTENT); UDP 514; 1024-byte limit |
| RFC 5424 The Syslog Protocol | Standards Track | March 2009 | Message format with VERSION, RFC 3339 timestamp, APP-NAME, PROCID, MSGID and STRUCTURED-DATA |
| RFC 5425 TLS Transport Mapping for Syslog | Standards Track | March 2009 | Syslog over TLS on TCP 6514 with octet-counting framing and certificate authentication |
| RFC 5426 Transmission of Syslog Messages over UDP | Standards Track | March 2009 | One message per datagram on UDP 514, size and checksum rules |
| RFC 5848 Signed Syslog Messages | Standards Track | May 2010 | syslog-sign: signature and certificate blocks carried as structured data |
| RFC 6587 Transmission of Syslog Messages over TCP | Historic | April 2012 | Records existing plain-TCP framing (octet counting and LF-terminated); not recommended for deployment |
| RFC 9662 Updates to the Cipher Suites in Secure Syslog | Standards Track | October 2024 | Updates RFC 5425 and RFC 6012 (DTLS): new mandatory cipher suite, TLS 1.3 preferred, no 0-RTT |
Both formats remain common: many devices emit RFC 3164 style by default, so configure senders for RFC 5424 wherever they support it.
RFC 3164 vs 5424
An RFC 5424 message is PRI VERSION SP TIMESTAMP SP HOSTNAME SP APP-NAME SP PROCID SP MSGID SP STRUCTURED-DATA [SP MSG]. Empty header fields carry the NILVALUE, a hyphen. An RFC 3164 message is PRI, a HEADER (timestamp, hostname), then MSG, whose first word is the TAG.
| Field or property | RFC 3164 (BSD syslog) | RFC 5424 (The Syslog Protocol) | Parsing consequence |
|---|---|---|---|
| PRI | <n>, 3 to 5 characters | <n>, PRIVAL 0 to 191, no leading zeros | Same calculation in both; reject values above 191 |
| Version | None | 1 immediately after PRI | A digit after > is the quickest way to detect RFC 5424 |
| Timestamp | Local time, Mmm dd hh:mm:ss, no year, no zone, single-digit day space-padded | RFC 3339 with mandatory T, upper-case Z or numeric offset, optional fraction up to 6 digits, no leap seconds | RFC 3164 times need the collector to infer year and zone, which breaks at year end and across regions |
| Hostname | Hostname, or IP address if none | FQDN preferred, then static IP, hostname, dynamic IP, or NILVALUE; maximum 255 characters | Not proof of origin: record the source IP separately |
| Application identity | TAG, up to 32 alphanumeric characters, often with [pid] | APP-NAME (48), PROCID (128) and MSGID (32) as separate fields | RFC 5424 lets rules key on MSGID instead of regex on free text |
| Structured data | None | Zero or more [SD-ID param="value"] elements, or NILVALUE | Key-value pairs without custom parsers |
| Message body | CONTENT, usually printable ASCII | MSG, UTF-8 starting with a BOM when UTF-8 is used | Handle the BOM and reject invalid UTF-8 |
| Size | Packet must not exceed 1024 bytes | Receivers must accept 480 octets, should accept 2048, may accept more | Long messages are truncated: keep key fields early |
RFC 3164 relays may rewrite messages: one with no valid timestamp gets the relay's own, and one with no recognisable PRI gets PRI 13 and a new header. RFC 5424 forbids transports from altering messages, so old relays in the path leave records carrying the relay's time and hostname.
The same event in both formats looks like this (illustrative values):
- RFC 3164:
<38>Nov 26 09:14:02 fw01 sshd[4121]: Accepted publickey for deploy from 192.0.2.10 - RFC 5424:
<38>1 2026-11-26T09:14:02.331Z fw01.example.net sshd 4121 AUTH [timeQuality tzKnown="1" isSynced="1"] Accepted publickey for deploy from 192.0.2.10
PRI 38 is facility 4 (security/authorisation) at severity 6. Only the second record gives the year, the zone, clock sync status and a message identifier.
Facilities and severities
RFC 5424 keeps the facility and severity numbering from RFC 3164. Both are set by the sender, so treat them as routing hints, not trustworthy classifications.
Severity codes
| Code | Severity | Typical meaning | Collection guidance |
|---|---|---|---|
| 0 | Emergency | System is unusable | Always collect and alert |
| 1 | Alert | Action must be taken immediately | Always collect and alert |
| 2 | Critical | Critical conditions | Always collect |
| 3 | Error | Error conditions | Always collect |
| 4 | Warning | Warning conditions | Always collect |
| 5 | Notice | Normal but significant condition | Collect: many configuration change events sit here |
| 6 | Informational | Informational messages | Collect for security sources: logins and sessions are often here |
| 7 | Debug | Debug-level messages | Only for troubleshooting, time-limited |
Forwarding only severity 0 to 4 removes logins and configuration changes, which are often Notice or Informational: forward severities 0 to 6 (Emergency to Informational) from security sources and filter by content instead.
Facility codes
| Code | Facility | Code | Facility |
|---|---|---|---|
| 0 | kernel messages | 12 | NTP subsystem |
| 1 | user-level messages | 13 | log audit |
| 2 | mail system | 14 | log alert |
| 3 | system daemons | 15 | clock daemon |
| 4 | security/authorisation messages | 16 | local use 0 (local0) |
| 5 | messages generated internally by syslogd | 17 | local1 |
| 6 | line printer subsystem | 18 | local2 |
| 7 | network news subsystem | 19 | local3 |
| 8 | UUCP subsystem | 20 | local4 |
| 9 | clock daemon | 21 | local5 |
| 10 | security/authorisation messages | 22 | local6 |
| 11 | FTP daemon | 23 | local7 |
Facilities 4 and 10 are both security/authorisation, and 9 and 15 are both clock daemon: RFC 5424 notes that different operating systems use these codes inconsistently. On Linux, auth and authpriv commonly map to 4 and 10, and authpriv is meant for private authentication detail. The local0 to local7 facilities have no fixed meaning: network devices, load balancers and applications pick one, often local7 by default. Record each source's facility in the inventory so two products sharing local7 are not parsed as one.
Structured data
STRUCTURED-DATA is the main reason to prefer RFC 5424. Each SD-ELEMENT is a bracketed SD-ID followed by zero or more name="value" parameters, and elements sit next to each other with no space. SD-IDs are case-sensitive and must be unique within a message; parameter names are 1 to 32 printable characters.
- Registered SD-IDs: names without an
@, controlled by IANA through IETF Review. RFC 5424 registers three, all with optional parameters. - Private SD-IDs:
name@<private enterprise number>, for exampleexampleSDID@32473. 32473 is reserved for documentation examples. - Escaping: inside a value,
",\and]must be escaped with a backslash. Values are UTF-8. A parser that ignores escaping can be tricked into ending an element early, which is a log injection risk.
| SD-ID | Parameters | Security use |
|---|---|---|
timeQuality | tzKnown (1 or 0), isSynced (1 or 0), syncAccuracy (microseconds, absent if not synced) | Tells the analyst whether the timestamp can be used for timeline ordering across sources |
origin | ip (repeatable), enterpriseId, software (48), swVersion (32) | Identifies the originator through relays and NAT, and the software version for vulnerability context |
meta | sequenceId (1 to 2147483647, then wraps to 1), sysUpTime, language | Gaps in sequenceId reveal lost or suppressed messages; a reset of sysUpTime shows a reboot |
Signed syslog (RFC 5848) carries its ssign and ssign-cert elements as structured data, so it only works with RFC 5424 messages.
A sender controls every field, so values can carry control characters or oversized strings. RFC 5424 warns that control characters can hide content and that truncation can hide information at the end of a message. See the Log Injection and Log Forging Guide.
Transport security
The syslog protocol has no built-in authentication, integrity, confidentiality, delivery acknowledgement or replay detection. RFC 3164 and RFC 5426 both warn that messages can be forged, replayed, altered, read or silently dropped, and RFC 5426 states that using UDP on an unsecured network is not recommended. The protection has to come from the transport or from signing.
| Option | Port and framing | Protects | Does not protect | When to use |
|---|---|---|---|---|
| UDP (RFC 5426) | UDP 514, one message per datagram; IPv4 receivers must take 480 octets, IPv6 1180, all should take 2048 | Nothing beyond checksums | Loss, ordering, forgery, replay, eavesdropping | Isolated, capacity-provisioned management networks only, with source IP filtering |
| Plain TCP (RFC 6587, Historic) | TCP; octet counting or LF-terminated (non-transparent) framing | Network-level delivery | Forgery, eavesdropping; LF framing can split or merge messages | Legacy interoperability only; the IESG does not recommend it |
| TLS (RFC 5425, updated by RFC 9662) | TCP 6514, octet counting (MSG-LEN SP SYSLOG-MSG); receivers must take 2048 octets, should take 8192 | Confidentiality and integrity in transit, peer authentication by certificate or fingerprint | Messages at rest on relays; application-layer loss | Default for any syslog crossing shared or untrusted networks |
| Signed syslog (RFC 5848) | Any transport; signature blocks in structured data | Origin authentication, integrity, replay and gap detection, end to end and offline | Confidentiality (no encryption) | Forensic-grade records that pass through relays or are stored long-term |
RFC 5425 requires both sides to implement certificate authentication, supporting both certification path validation and end-entity certificate fingerprint matching, and recommends mutual authentication by default. RFC 9662 (October 2024) keeps TLS 1.2 as mandatory to implement, adds TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 as a mandatory cipher suite that should be offered alongside the original TLS_RSA_WITH_AES_128_CBC_SHA, says TLS 1.3 should be supported and preferred when implemented, forbids DTLS 1.0, and prohibits TLS 1.3 early data because syslog has no replay protection. Prefer TLS 1.3 and drop the RSA key exchange suite once every peer supports ECDHE.
TLS protects the hop, not the record: RFC 5848 notes it does not protect against application-layer loss, and a compromised relay can drop or rewrite messages before re-sending them. Signed syslog adds hashes, sequence numbers and a block counter for later verification, but few senders implement it, so most organisations rely on TLS plus write-once storage. See the Log Management and Retention Guide.
Where identity fits
Every TLS syslog sender and collector holds a certificate and private key, which makes it a machine identity with its own lifecycle. An expired sender certificate silently stops logging, and a stolen collector key allows impersonation. Issue syslog certificates from an internal CA with short validity and automated renewal, and track the certificates in your machine identity inventory. See the NHI Discovery Across Cloud, SaaS, CI/CD and On-Premises Environments guide.
Implementation and decision guidance
- Inventory senders. Record format, facility, transport, port, time zone and TLS support for each source.
- Fix time first. Point every sender at the same NTP sources, and prefer UTC timestamps with an explicit offset. See the NTP Security Guide.
- Stand up a TLS listener alongside UDP. Run the collector on TCP 6514 with a server certificate from an internal CA while the existing UDP 514 listener stays up.
- Pilot one sender class. Move a small ring (for example Linux hosts) to RFC 5424 over TLS and compare per-host event counts and parsed fields against the old feed for a week.
- Roll out by ring, keep a rollback. Keep UDP 514 restricted to known sources until each ring is confirmed; rollback is pointing senders back to UDP.
- Handle the exceptions. For UDP-only senders, relay locally on the isolated segment and forward over TLS, or use IPsec.
- Close the old path. Remove UDP 514 from firewalls between segments once migration is complete, and alert on any datagram that still arrives.
Decision guidance: a small organisation can send RFC 5424 over TLS straight to one collector or a cloud SIEM endpoint. A large estate needs regional relays, disk-assisted sender queues, a parser per dialect and certificate automation. Choose signed syslog only where provable integrity of the original record is required and senders support it.
Detection and measurement
- Silent sources: alert when an inventoried sender has sent nothing for longer than its normal interval. Stopping logging is a defence impairment technique (ATT&CK T1685 Disable or Modify Tools).
- Sequence gaps: where
meta sequenceIdis present, alert on gaps and on resets that do not coincide with asysUpTimereset. - Spoofed origin: compare HOSTNAME with the connection source IP and TLS peer certificate.
- Clock and parser problems: flag timestamps far from receive time and messages landing in an unparsed bucket.
| Metric | Target |
|---|---|
| Inventoried syslog sources reporting in the last 24 hours | 100 per cent of in-scope sources |
| Sources sending over TLS or IPsec | Rising to 100 per cent outside isolated management segments |
| Unparsed or catch-all message rate | Below 1 per cent per source |
| Median time to detect a silent source | Under one hour for critical sources |
| Syslog TLS certificates expiring within 14 days without a renewal | Zero |
Framework mapping
| Framework | Reference | Syslog relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | AU-3 Content of Audit Records; AU-8 Time Stamps | Header fields, structured data and RFC 3339 timestamps |
| NIST SP 800-53 Rev 5 | AU-9 Protection of Audit Information; SC-8 Transmission Confidentiality and Integrity | TLS transport, signed syslog, write-once storage |
| NIST SP 800-53 Rev 5 | AU-4 Audit Log Storage Capacity; AU-6 Audit Record Review, Analysis, and Reporting; AU-10 Non-repudiation | Collector sizing, review, RFC 5848 origin authentication |
| NIST CSF 2.0 | PR.PS-04; DE.CM-01; DE.AE-03 | Log generation, network monitoring, correlation across sources |
| CIS Controls v8.1 | Control 8 Audit Log Management | Time synchronisation and centralised collection |
| ISO/IEC 27001:2022 Annex A | 8.15 Logging; 8.17 Clock synchronisation | Producing, protecting and time-aligning logs |
| MITRE ATT&CK v20 | T1685 Disable or Modify Tools | Detecting stopped or altered logging |
Common failure patterns
- Severity threshold too high: forwarding only Warning and above drops authentication and configuration events logged at Notice or Informational.
- Trusting HOSTNAME: using the header hostname as the asset key lets any host on the network write records for another; key on the authenticated peer or source IP.
- LF framing over TCP: multi-line messages such as stack traces are split into fragments, and an embedded newline can create a forged second record.
- TLS without authentication: encrypting to a collector without validating its certificate, or accepting any client, gives confidentiality against passive observers only.
- No queueing: senders with in-memory queues lose everything during a collector or TLS outage, often exactly when an incident is under way. See the Log pipeline (collectors, forwarders, data pipeline) health check.
Practitioner checklist
- Inventory every syslog source.
- Configure senders for RFC 5424 output with UTC or explicit-offset timestamps where supported.
- Synchronise all senders and collectors to common NTP sources and emit
timeQualitywhere available. - Forward severity 6 and above from security-relevant sources and filter by content downstream.
- Move off UDP 514 to TLS on TCP 6514 with mutual certificate authentication; prefer TLS 1.3 and never enable 0-RTT.
- Alert on silent sources, sequence gaps and hostname to source mismatches.
- Automate renewal of syslog TLS certificates and track them as machine identities.
Standards and references
- IETF: RFC 5424 The Syslog Protocol
- IETF: RFC 3164 The BSD syslog Protocol
- IETF: RFC 5425 Transport Layer Security (TLS) Transport Mapping for Syslog
- IETF: RFC 9662 Updates to the Cipher Suites in Secure Syslog
- IETF: RFC 5426 Transmission of Syslog Messages over UDP
- IETF: RFC 5848 Signed Syslog Messages
- IETF: RFC 6587 Transmission of Syslog Messages over TCP
- CISA and partners: Best Practices for Event Logging and Threat Detection
Related NHI Mgmt Group resources: Network Device Syslog and Configuration Change Detection Guide · Linux Logging and auditd for Defenders Guide · CIS Control 8 Audit Log Management Guide · NIST SP 800-92 Log Management Guide