✓ Copied to clipboard!
UNIT 1 · INTRODUCTION

SYSLOG Protocol

The universal standard for message logging across network devices, servers, and applications — defined in RFC 5424.

What is SYSLOG?

SYSLOG is a standard protocol that allows network devices, operating systems, and applications to send event messages to a centralized logging server. Originally developed for BSD Unix, it is now the de facto standard for log management across routers, switches, firewalls, servers, and virtually every networked device.

The protocol operates on a client-server model: devices (originators) generate log messages and transmit them to a syslog server (collector). Syslog is defined in RFC 5424 (2009), which superseded the older RFC 3164 (BSD syslog).

📌 Key Fact: By default, syslog uses UDP port 514. For reliable delivery, TCP port 514 or TLS/TCP port 6514 may be used. UDP offers no delivery guarantee — messages can be lost silently.

📋
RFC 5424

Structured Logging

The modern IETF standard provides a consistent, parseable format with clearly defined fields for priority, timestamp, hostname, application, and structured data.

📡
Transport

Multiple Transport Options

Syslog messages can travel over UDP (unreliable, low overhead), TCP (reliable), or TLS-encrypted TCP for secure transmission in compliance environments.

🔍
Use Cases

Security & Monitoring

Used for security auditing, compliance (PCI DSS, HIPAA, SOX), troubleshooting, performance monitoring, and SIEM integration across enterprise environments.

⚙️
Priority System

Facility + Severity = PRI

Every message carries a Priority (PRI) value, mathematically derived from a Facility code (source type) and a Severity level (urgency), giving 192 possible combinations.

🌐
Scope

Universal Device Support

Routers, switches, firewalls, Linux/Unix servers, Windows (via agents), printers, and IoT devices all speak syslog — making it the lingua franca of network logging.

🏛️
Standards

Key RFCs

  • RFC 3164 — Original BSD syslog
  • RFC 5424 — Modern syslog standard
  • RFC 5425 — TLS transport
  • RFC 5426 — UDP transport
  • RFC 6587 — TCP transport

Why Network Admins Must Master SYSLOG

📌 Operational Visibility

Syslog messages reveal device status, interface changes, routing protocol events, authentication attempts, and system errors in near real-time.

🔐 Security Incident Detection

Failed login attempts, ACL violations, port scans, and firewall rule triggers all generate syslog messages. Without syslog, these events are invisible.

📊 Compliance Requirements

PCI DSS, HIPAA, SOX, and NIST SP 800-92 all mandate centralized log management. Syslog is typically the mechanism for collecting those logs.

🔧 Troubleshooting

Network outages, routing loops, spanning tree topology changes, and hardware failures all leave traces in syslog — often before users even notice.

📈 Capacity Planning

Traffic spikes, memory exhaustion warnings, and interface error rates surfaced in syslog data inform infrastructure planning decisions.

🔗 SIEM Integration

Security Information and Event Management (SIEM) platforms like Splunk, IBM QRadar, and Microsoft Sentinel ingest syslog as a primary data source.

UNIT 2 · STRUCTURE

Syslog Message Format

Understanding the anatomy of a syslog message — from the PRI value to structured data and the message body.

RFC 5424 Message Structure

A complete syslog message has three top-level components. Hover over each field below for details:

PRI
<34>
PRIORITY (PRI)
Encodes both Facility and Severity. Format: <PRIVAL> where PRIVAL = (Facility × 8) + Severity. Range: 0–191.
VER
1
VERSION
Syslog protocol version. Currently "1" for RFC 5424. Incremented when the protocol changes.
TIMESTAMP
2024-03-15T…
TIMESTAMP
ISO 8601 / RFC 3339 format. Includes date, time, optional fractional seconds (up to 6 digits), and timezone offset. Example: 2024-03-15T14:22:05.003Z
HOSTNAME
router01
HOSTNAME
FQDN, IPv4, or IPv6 address of the originating device. Max 255 chars. Use "-" (NILVALUE) if unavailable.
APP-NAME
sshd
APP-NAME
Name of the application or device generating the message. Max 48 chars. Use "-" if unknown.
PROCID
12345
PROCID
Process ID or name generating the message. Max 128 chars. Indicates a discontinuity in reporting if it changes.
MSGID
ID47
MSGID
Identifies the type/category of message. Messages with the same semantics share the same MSGID. Max 32 chars.
STRUCT-DATA
[sd@123…]
STRUCTURED-DATA
Key-value pairs in a defined format: [SD-ID param="value"]. Allows machine-parseable data. Use "-" if none.
MESSAGE
Login failed for user admin
MSG
Free-form human-readable message text. UTF-8 encoded. No length limit enforced by RFC 5424, but transport may limit size.

💡 Hover over each colored field in the diagram above to learn about that field's purpose, format, and constraints.

Live Message Example

This is a fully-formed RFC 5424 syslog message. Each color corresponds to a field in the diagram above:

<34>1 2024-03-15T14:22:05.003Z router01.corp.com sshd 12345 ID47 [exampleSDID@32473 iut="3" eventSource="Application"] Login failed for user admin from 192.168.1.100

─────────────────────────────────────────────────────────────
PRI=34 → Facility=4 (AUTH), Severity=2 (CRITICAL) | Facility=(34÷8)=4, Severity=(34%8)=2

RFC 3164 vs RFC 5424 Comparison

RFC 3164 (2001) is the original BSD syslog format. It's widely implemented but has inconsistencies and is harder to parse automatically.

<34>Mar 15 14:22:05 router01 sshd[12345]: Login failed for user admin

Limitations of RFC 3164:

  • No year in timestamp (makes log correlation difficult)
  • No timezone information (ambiguous log ordering)
  • No structured data field
  • No message ID field
  • TAG/CONTENT split is ambiguous
  • Maximum message size limited to 1024 bytes

RFC 5424 (2009) addresses all legacy limitations with a fully structured, parseable format.

<34>1 2024-03-15T14:22:05.003Z router01.corp.com sshd 12345 ID47 [timeQuality tzKnown="1"] Login failed for user admin

Improvements in RFC 5424:

  • Full ISO 8601 timestamp — includes year, timezone, microseconds
  • HOSTNAME should be FQDN for uniqueness
  • APP-NAME, PROCID, MSGID are separate header fields
  • STRUCTURED-DATA allows key-value metadata
  • UTF-8 encoding explicitly supported for MSG
  • No enforced maximum message length
FeatureRFC 3164 (BSD)RFC 5424 (IETF)
Year in timestamp❌ No✅ Yes
Timezone support❌ No✅ Yes (UTC/offset)
Microsecond precision❌ No✅ Up to 6 digits
Structured data❌ No✅ Yes
Message ID field❌ No✅ Yes (MSGID)
APP-NAME fieldPartial (TAG)✅ Explicit
Max message size1024 bytesNo hard limit (RFC)
Character encodingASCII assumed✅ UTF-8 explicit
NILVALUE support❌ No✅ Yes ("-")
StatusInformational/LegacyStandards Track

ABNF Grammar (RFC 5424)

The Augmented Backus-Naur Form (ABNF) definition shows the exact message structure:

; Complete RFC 5424 SYSLOG message grammar
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
TIMESTAMP = NILVALUE / FULL-DATE "T" FULL-TIME
HOSTNAME = NILVALUE / 1*255PRINTUSASCII
APP-NAME = NILVALUE / 1*48PRINTUSASCII
PROCID = NILVALUE / 1*128PRINTUSASCII
MSGID = NILVALUE / 1*32PRINTUSASCII
STRUCT-DATA = NILVALUE / 1*SD-ELEMENT
SD-ELEMENT = "[" SD-ID *(SP SD-PARAM) "]"
MSG = MSG-ANY / MSG-UTF8
UNIT 3 · PRIORITY SYSTEM

Facilities & Severity Levels

The PRI value encodes both the message source (Facility) and urgency (Severity) into a single number using a simple formula.

The PRI Formula

PRI = (Facility × 8) + Severity

Range: 0 (KERN/EMERG) to 191 (LOCAL7/DEBUG)

The PRI value is always enclosed in angle brackets in the message, e.g., <34>. To decode it: Facility = ⌊PRI ÷ 8⌋, Severity = PRI mod 8.

CodeFacilityDescriptionTypical Source
0kernKernel messagesLinux/Unix kernel
1userUser-level messagesUser processes
2mailMail systemsendmail, postfix
3daemonSystem daemonsVarious system services
4authSecurity/authorizationSSH, sudo, login
5syslogSyslog internal messagessyslogd itself
6lprLine printer subsystemPrint services
7newsNetwork news subsystemNNTP services
8uucpUUCP subsystemUUCP protocol
9cronClock daemoncron, at
10authprivSecurity (private)PAM, private auth logs
11ftpFTP daemonFTP servers
12ntpNTP subsystemNTP synchronization
13auditLog auditSecurity audit logs
14alertLog alertAlert generation
15clockClock daemonClock/time services
16–23local0–local7Local useCustom device/app logs (Cisco, Juniper, etc.)

📌 Network Admin Tip: Cisco IOS and Junos devices use local6 or local7 (codes 22–23) by default for their syslog messages. Always confirm the facility your network devices are configured to use.

LevelNameKeywordDescriptionAction Required
0EmergencyemergSystem is unusable🚨 Immediate action required
1AlertalertAction must be taken immediately🚨 Immediate action required
2CriticalcritCritical conditions🔴 Urgent response needed
3ErrorerrError conditions🔴 Fix required
4WarningwarningWarning conditions🟡 Monitor and investigate
5NoticenoticeNormal but significant condition🟡 Note for review
6InformationalinfoInformational messages🟢 Normal operations
7DebugdebugDebug-level messages⚪ Development/troubleshooting

⚠️ Cisco Note: Cisco IOS uses reversed severity naming in some contexts. In Cisco's logging levels command: level 0 = emergencies, level 7 = debugging — which matches RFC 5424. Set logging trap warnings to send levels 0–4 to the syslog server.

Use this interactive calculator to encode or decode any PRI value.

🔢 Encode (Facility + Severity → PRI)

PRI VALUE
<34>
(4 × 8) + 2 = 34

🔍 Decode (PRI → Facility + Severity)

Facility: 4 (auth)
Severity: 2 (Critical)
Formula: 34 ÷ 8 = 4 rem 2
PRI <34> = Security/Authorization + Critical
UNIT 4 · INTERACTIVE TOOL

Syslog Header Builder

Build a valid RFC 5424 syslog message by filling in each field. The message updates in real time as you type.

⚙️ Configure Header Fields

① Priority (PRI)

PRI = (Facility 22 × 8) + Severity 5 =
<181>

② Header Fields

③ Structured Data (optional — use "-" for none)

④ Message Body

📤 GENERATED SYSLOG MESSAGE (RFC 5424)
Building…
📊 FIELD BREAKDOWN

✅ Validation Rules: HOSTNAME max 255 chars · APP-NAME max 48 chars · PROCID max 128 chars · MSGID max 32 chars · Use - (NILVALUE) for any optional field with no data · Facility 0–23 · Severity 0–7

UNIT 5 · DEPLOYMENT

Syslog Architecture & Deployment

How syslog messages flow from devices through the network to collectors, and how administrators configure enterprise logging infrastructure.

Syslog Architecture Components

📡 Originator
Router, Switch, Firewall, Server
🔀 Relay
(Optional) Log Aggregator
💾 Collector
Syslog Server / SIEM
🔍 Analyzer
Dashboard / Alerts
📡
ORIGINATOR

Message Sources

Any device generating log data. Configuring an originator involves setting the syslog server IP, port, transport protocol, and the minimum severity level to transmit.

# Cisco IOS Configuration
logging host 192.168.1.100
logging trap warnings
logging facility local7
service timestamps log datetime msec
🔀
RELAY

Log Aggregation

Relays receive syslog from multiple sources, optionally filter/transform messages, and forward to a central collector. Tools like rsyslog and syslog-ng act as relays.

# rsyslog forwarding rule
*.warning @@192.168.1.200:514
# @@ = TCP, @ = UDP
💾
COLLECTOR

Log Servers & SIEM

Central repository for all syslog data. Common solutions include Splunk, Graylog, ELK Stack (Elasticsearch), IBM QRadar, and Microsoft Sentinel.

Transport Protocol Comparison

TransportRFCPortDeliverySecurityUse Case
UDPRFC 5426514Best-effort (unreliable)NoneLAN environments, high-volume, low-overhead logging
TCPRFC 6587514Reliable (guaranteed delivery)NoneCritical logs, WAN environments where loss is unacceptable
TLS/TCPRFC 54256514ReliableEncryption + AuthenticationCompliance environments (PCI, HIPAA), internet transmission

Common Syslog Tools & Daemons

🐧 rsyslog — Rocket-fast System for Log Processing

The most widely deployed syslog daemon on Linux systems (Ubuntu, CentOS, RHEL). Supports both RFC 3164 and RFC 5424, TCP/UDP/TLS, and complex filtering rules.

# /etc/rsyslog.conf — Enable TCP syslog server
module(load="imtcp")
input(type="imtcp" port="514")

# Forward to remote server
*.* @@192.168.1.200:514
🔧 syslog-ng — Next-Generation Syslog Daemon

Advanced syslog daemon with powerful message routing, filtering, and transformation capabilities. Popular in enterprise environments requiring complex log processing pipelines.

# syslog-ng.conf example
source s_net { network(transport("udp") port(514)); };
destination d_file { file("/var/log/network.log"); };
log { source(s_net); destination(d_file); };
📊 Splunk — Enterprise Log Analysis Platform

Industry-leading platform for ingesting, indexing, and analyzing syslog and other log data. Uses the Splunk Processing Language (SPL) for searching and correlation. Widely used for security operations (SIEM).

  • Accepts syslog directly via UDP/TCP on customizable ports
  • Built-in syslog field extraction (Facility, Severity, Hostname)
  • Real-time dashboards and alerting
  • Correlates syslog with other data sources (Netflow, SNMP, etc.)
🟢 Graylog — Open Source Log Management

Open-source centralized log management platform built on Elasticsearch. Natively understands RFC 5424 structured data and provides powerful search and alerting capabilities at lower cost than Splunk.

Cisco IOS Syslog Configuration Reference

! ── Cisco IOS Syslog Best-Practice Configuration ──
logging host 192.168.100.50 ! Syslog server IP
logging trap informational ! Send severity 0-6
logging facility local7 ! Use local7 (code 23)
service timestamps log datetime msec year show-timezone
logging buffered 64000 debugging ! Local buffer size
!
! Optional: Use source interface for consistent logging IP
logging source-interface Loopback0
UNIT 6 · SECURITY

Syslog Security Considerations

Syslog carries critical security event data, yet the protocol itself has no built-in authentication, integrity checking, or confidentiality by default.

🔴 Critical Vulnerability: Default UDP syslog has NO authentication, NO encryption, and NO delivery guarantee. Any host on the network can forge syslog messages and spoof the source address.

🎭
THREAT

Log Spoofing

An attacker can send forged syslog messages to a collector, injecting false events, hiding malicious activity, or framing legitimate systems as attackers.

Mitigation: Use TLS (RFC 5425) with mutual certificate authentication, or restrict accepted source IPs on the collector.

🕵️
THREAT

Log Replay Attacks

An attacker records legitimate syslog messages and replays them later to obscure an ongoing attack or confuse timeline analysis.

Mitigation: RFC 5848 (Signed Syslog Messages) provides cryptographic signing with sequence numbers to detect replay.

🌊
THREAT

Log Flooding (DoS)

An attacker generates massive volumes of syslog messages to overwhelm the collector's storage, CPU, or network bandwidth, potentially causing legitimate messages to be dropped.

Mitigation: Rate limiting, dedicated logging networks, and syslog server capacity planning.

🔓
THREAT

Eavesdropping

UDP syslog messages traverse the network in cleartext. Any network device or attacker with packet capture capability can read all log entries.

Mitigation: TLS/TCP (RFC 5425) on port 6514 encrypts the syslog stream. Use a dedicated VLAN for logging traffic.

📝
BEST PRACTICE

Log Integrity & Tampering

Logs stored on compromised systems can be modified to cover attacker tracks. Log-forwarding to an out-of-band system ensures tamper-evident records.

Mitigation: Forward logs in real-time to a write-once or immutable storage system. Use WORM (Write Once Read Many) media.

BEST PRACTICE

Time Synchronization

Log correlation across multiple devices requires accurate, synchronized timestamps. Unsynchronized clocks make incident timeline reconstruction impossible.

Mitigation: NTP on all devices. Configure NTP before logging. The TIMESTAMP field in RFC 5424 includes timezone, making cross-timezone correlation feasible.

Compliance & Log Retention Requirements

Framework/RegulationLog RetentionKey Requirement
PCI DSS12 months (3 months online)Centralized logging of all system components; daily log review
HIPAA6 yearsAudit controls, information activity review, access logs
SOX (Sarbanes-Oxley)7 yearsFinancial system logs to prevent tampering and ensure accountability
NIST SP 800-92Varies (90 days minimum typical)Guide for computer security log management; defines log management infrastructure
ISO 27001Defined by risk assessmentEvent logging, monitoring system use, protecting log information
FISMA / FedRAMP90+ days online, 3 years totalCentralized logging, automated log analysis, incident response integration

Security Best Practices Checklist

✅ Transport Security — Encrypt your syslog
  • Use TLS/TCP on port 6514 (RFC 5425) for all syslog transmission across untrusted networks
  • Deploy mutual TLS (mTLS) so both client and server authenticate with certificates
  • Place logging traffic on a dedicated management VLAN
  • Apply ACLs/firewall rules restricting syslog traffic to known device IPs only
✅ Log Integrity — Ensure logs cannot be altered
  • Forward logs in real-time to a separate, hardened logging server
  • Consider RFC 5848 signed syslog for cryptographic message integrity and non-repudiation
  • Store logs on WORM media or immutable object storage (AWS S3 Object Lock, etc.)
  • Restrict write access to log files — only the syslog daemon should write
✅ Monitoring — Act on what you collect
  • Configure real-time alerts for Severity 0–3 (Emergency through Error) events
  • Integrate with a SIEM for correlation across multiple log sources
  • Establish a log review process — daily for security-critical systems
  • Create dashboards tracking top talkers, error rates, authentication failures
  • Monitor for syslog server availability — configure devices to alert on logging failures
UNIT 7 · ASSESSMENT

Knowledge Check

Test your understanding of syslog concepts. Select the best answer for each question.

Q1 What is the default transport protocol and port number used by syslog?

A
TCP port 514
B
UDP port 514
C
TLS/TCP port 6514
D
UDP port 162

Q2 A syslog message has a PRI value of <165>. What is the Facility code and Severity level?

A
Facility 21, Severity 3 (Error)
B
Facility 20 (local4), Severity 5 (Notice)
C
Facility 16, Severity 5 (Notice)
D
Facility 23 (local7), Severity 4 (Warning)

Q3 Which RFC defines the modern, structured syslog protocol standard currently in use?

A
RFC 3164
B
RFC 3195
C
RFC 5424
D
RFC 5425

Q4 What does a Severity level of 0 indicate in the syslog priority system?

A
Debug — lowest priority, verbose logging
B
Informational — routine system messages
C
Warning — potential issue detected
D
Emergency — system is unusable

Q5 Which field in an RFC 5424 syslog header provides key-value structured metadata about the event?

A
MSGID
B
APP-NAME
C
STRUCTURED-DATA
D
PROCID

Q6 A Cisco router is configured with logging trap warnings. Which severity levels will be sent to the syslog server?

A
Severity levels 0–7 (all messages)
B
Severity levels 0–4 (Emergency through Warning)
C
Only Severity level 4 (Warning only)
D
Severity levels 4–7 (Warning through Debug)

Q7 What is the primary security concern with using default UDP syslog for transmitting sensitive network events?

A
UDP causes message fragmentation that corrupts log data
B
UDP has higher overhead than TCP syslog
C
No authentication, encryption, or integrity checking — messages can be intercepted or forged
D
UDP syslog enforces strict ordering that attackers can exploit
Quiz Complete!
0/7