Join our Newsletter — 33% off our NHI Course
Home› Guides› Syslog Protocol Guide: RFC 3164 vs RFC 5424,…
Guide SOC & Detection Engineering

Syslog Protocol Guide: RFC 3164 vs RFC 5424, Facilities, Severities and Structured Data

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 15 min read
On this page

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, origin and meta, 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:

DocumentStatusDateWhat it defines
RFC 3164 The BSD syslog ProtocolInformational (obsoleted by RFC 5424)August 2001Observed legacy format: PRI, HEADER (TIMESTAMP, HOSTNAME), MSG (TAG, CONTENT); UDP 514; 1024-byte limit
RFC 5424 The Syslog ProtocolStandards TrackMarch 2009Message format with VERSION, RFC 3339 timestamp, APP-NAME, PROCID, MSGID and STRUCTURED-DATA
RFC 5425 TLS Transport Mapping for SyslogStandards TrackMarch 2009Syslog over TLS on TCP 6514 with octet-counting framing and certificate authentication
RFC 5426 Transmission of Syslog Messages over UDPStandards TrackMarch 2009One message per datagram on UDP 514, size and checksum rules
RFC 5848 Signed Syslog MessagesStandards TrackMay 2010syslog-sign: signature and certificate blocks carried as structured data
RFC 6587 Transmission of Syslog Messages over TCPHistoricApril 2012Records existing plain-TCP framing (octet counting and LF-terminated); not recommended for deployment
RFC 9662 Updates to the Cipher Suites in Secure SyslogStandards TrackOctober 2024Updates 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 propertyRFC 3164 (BSD syslog)RFC 5424 (The Syslog Protocol)Parsing consequence
PRI<n>, 3 to 5 characters<n>, PRIVAL 0 to 191, no leading zerosSame calculation in both; reject values above 191
VersionNone1 immediately after PRIA digit after > is the quickest way to detect RFC 5424
TimestampLocal time, Mmm dd hh:mm:ss, no year, no zone, single-digit day space-paddedRFC 3339 with mandatory T, upper-case Z or numeric offset, optional fraction up to 6 digits, no leap secondsRFC 3164 times need the collector to infer year and zone, which breaks at year end and across regions
HostnameHostname, or IP address if noneFQDN preferred, then static IP, hostname, dynamic IP, or NILVALUE; maximum 255 charactersNot proof of origin: record the source IP separately
Application identityTAG, up to 32 alphanumeric characters, often with [pid]APP-NAME (48), PROCID (128) and MSGID (32) as separate fieldsRFC 5424 lets rules key on MSGID instead of regex on free text
Structured dataNoneZero or more [SD-ID param="value"] elements, or NILVALUEKey-value pairs without custom parsers
Message bodyCONTENT, usually printable ASCIIMSG, UTF-8 starting with a BOM when UTF-8 is usedHandle the BOM and reject invalid UTF-8
SizePacket must not exceed 1024 bytesReceivers must accept 480 octets, should accept 2048, may accept moreLong 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

CodeSeverityTypical meaningCollection guidance
0EmergencySystem is unusableAlways collect and alert
1AlertAction must be taken immediatelyAlways collect and alert
2CriticalCritical conditionsAlways collect
3ErrorError conditionsAlways collect
4WarningWarning conditionsAlways collect
5NoticeNormal but significant conditionCollect: many configuration change events sit here
6InformationalInformational messagesCollect for security sources: logins and sessions are often here
7DebugDebug-level messagesOnly 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

CodeFacilityCodeFacility
0kernel messages12NTP subsystem
1user-level messages13log audit
2mail system14log alert
3system daemons15clock daemon
4security/authorisation messages16local use 0 (local0)
5messages generated internally by syslogd17local1
6line printer subsystem18local2
7network news subsystem19local3
8UUCP subsystem20local4
9clock daemon21local5
10security/authorisation messages22local6
11FTP daemon23local7

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 example exampleSDID@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-IDParametersSecurity use
timeQualitytzKnown (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
originip (repeatable), enterpriseId, software (48), swVersion (32)Identifies the originator through relays and NAT, and the software version for vulnerability context
metasequenceId (1 to 2147483647, then wraps to 1), sysUpTime, languageGaps 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.

OptionPort and framingProtectsDoes not protectWhen to use
UDP (RFC 5426)UDP 514, one message per datagram; IPv4 receivers must take 480 octets, IPv6 1180, all should take 2048Nothing beyond checksumsLoss, ordering, forgery, replay, eavesdroppingIsolated, capacity-provisioned management networks only, with source IP filtering
Plain TCP (RFC 6587, Historic)TCP; octet counting or LF-terminated (non-transparent) framingNetwork-level deliveryForgery, eavesdropping; LF framing can split or merge messagesLegacy 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 8192Confidentiality and integrity in transit, peer authentication by certificate or fingerprintMessages at rest on relays; application-layer lossDefault for any syslog crossing shared or untrusted networks
Signed syslog (RFC 5848)Any transport; signature blocks in structured dataOrigin authentication, integrity, replay and gap detection, end to end and offlineConfidentiality (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

  1. Inventory senders. Record format, facility, transport, port, time zone and TLS support for each source.
  2. Fix time first. Point every sender at the same NTP sources, and prefer UTC timestamps with an explicit offset. See the NTP Security Guide.
  3. 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.
  4. 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.
  5. 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.
  6. Handle the exceptions. For UDP-only senders, relay locally on the isolated segment and forward over TLS, or use IPsec.
  7. 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 sequenceId is present, alert on gaps and on resets that do not coincide with a sysUpTime reset.
  • 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.
MetricTarget
Inventoried syslog sources reporting in the last 24 hours100 per cent of in-scope sources
Sources sending over TLS or IPsecRising to 100 per cent outside isolated management segments
Unparsed or catch-all message rateBelow 1 per cent per source
Median time to detect a silent sourceUnder one hour for critical sources
Syslog TLS certificates expiring within 14 days without a renewalZero

Framework mapping

FrameworkReferenceSyslog relevance
NIST SP 800-53 Rev 5AU-3 Content of Audit Records; AU-8 Time StampsHeader fields, structured data and RFC 3339 timestamps
NIST SP 800-53 Rev 5AU-9 Protection of Audit Information; SC-8 Transmission Confidentiality and IntegrityTLS transport, signed syslog, write-once storage
NIST SP 800-53 Rev 5AU-4 Audit Log Storage Capacity; AU-6 Audit Record Review, Analysis, and Reporting; AU-10 Non-repudiationCollector sizing, review, RFC 5848 origin authentication
NIST CSF 2.0PR.PS-04; DE.CM-01; DE.AE-03Log generation, network monitoring, correlation across sources
CIS Controls v8.1Control 8 Audit Log ManagementTime synchronisation and centralised collection
ISO/IEC 27001:2022 Annex A8.15 Logging; 8.17 Clock synchronisationProducing, protecting and time-aligning logs
MITRE ATT&CK v20T1685 Disable or Modify ToolsDetecting 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 timeQuality where 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

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

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.