4. Capturing Logs with Syslog

“Centralize network logging with Syslog for comprehensive visibility and rapid troubleshooting.”

Network Management

A Practical Guide to Discovering, Maintaining, and Monitoring Your Network

Capturing Logs with Syslog

In any well-managed network, visibility is key, and Syslog is one of the most powerful tools for gaining it. Whether it’s a failed interface, unauthorized access attempt, or routine configuration change, your devices know what’s happening. Syslog provides the mechanism to capture and centralize those events.

Syslog is a universal logging protocol that enables network devices to send messages to a central syslog server, typically over UDP port 514. These logs contain two vital pieces of metadata:
  • A severity level (ranging from 0 for critical system failure to 7 for debug-level information). 
  • A facility code, which identifies the subsystem that generated the message, such as IP, OSPF, or the operating system itself. 
Syslog Severity Levels

Syslog Severity Levels

Level Severity Description Example Use Case
0 Emergency System is unusable Total system failure
1 Alert Action must be taken immediately Hardware failure detected
2 Critical Critical conditions Interface down
3 Error Error conditions Authentication failure
4 Warning Warning conditions High CPU usage
5 Notice Normal but significant Configuration change
6 Informational Informational messages User login
7 Debug Debug-level messages Protocol debugging
Facility Codes

Common facility codes help identify the source of messages:

  • 16-23: Local use 0-7 (customizable)
  • 0: Kernel messages
  • 1: User-level messages
  • 2: Mail system
  • 3: System daemons
  • 4: Security/auth messages
Why Timestamping Matters

# Cisco IOS timestamp configuration
service timestamps log datetime localtime show-timezone msec
service timestamps debug datetime localtime show-timezone msec

By enabling timestamping with commands like service timestamps log datetime, network administrators can correlate events across devices, especially useful when troubleshooting cascading failures or identifying root causes. Accurate timing is particularly critical in complex environments with high device density or multiple vendors.

Example: Correlated Event Timeline

10:15:32.123 Router-A: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1 changed state to down
10:15:32.125 Switch-B: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/24 changed state to down
10:15:32.127 Router-C: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.1 on GigabitEthernet0/0 from Full to Down

Broad Compatibility and Logging Tools
Supported Platforms
Syslog isn’t just for Cisco routers; it’s an open standard supported across platforms and operating systems:
Network Devices
  • Cisco: IOS, IOS-XE, IOS-XR, NX-OS
  • Juniper: Junos
  • Fortinet: FortiOS
  • HP/Aruba: ArubaOS, ProCurve
  • Arista: EOS
  • Ubiquiti: UniFi OS
Servers & Operating Systems
  • Linux: via rsyslog or syslog-ng
  • BSD: native syslog daemon
  • Windows: via agents (NXLog, Splunk UF)
Cloud Platforms
  • AWS: CloudWatch Logs
  • Azure: Monitor Logs
  • Google Cloud: Cloud Logging
Modern Log Analysis Tools Open Source Solutions

graph TD

A[Network Devices] –> B[Logstash]
B –> C[Elasticsearch]
C –> D[Kibana Dashboard]

A –> E[Graylog]
E –> F[MongoDB]
E –> G[Web Interface]

Popular Tools Comparison

Popular Tools Comparison

Tool Best For Key Features
Graylog Mid-size networks Real-time alerting, scalable, user-friendly
ELK Stack Large enterprises Powerful search, custom dashboards, real-time analytics
SolarWinds Enterprise networks SNMP/NetFlow correlation, vendor support
Splunk Complex environments Advanced analytics, machine learning, extensive integrations
Best Practices for Syslog Implementation

Best Practices for Syslog Implementation

1. Configure Appropriate Log Levels
# Cisco example - send only warnings and above logging trap warnings logging host 192.168.1.100
2. Implement Log Rotation
# Linux rsyslog rotation /var/log/network/*.log { daily missingok rotate 30 compress delaycompress copytruncate }
3. Set Up Centralized Time Synchronization
# NTP configuration is crucial for log correlation ntp server pool.ntp.org

Sample Syslog Configuration

Cisco Router/Switch
! Enable timestamp services service timestamps log datetime localtime show-timezone msec service timestamps debug datetime localtime show-timezone msec ! Configure syslog server logging host 192.168.1.100 logging trap informational logging facility local0 logging source-interface loopback0 ! Optional: Local logging buffer logging buffered 16384 informational
Linux rsyslog.conf
# Network device logs local0.* /var/log/network/cisco.log local1.* /var/log/network/juniper.log # Remote logging *.* @@192.168.1.100:514

Conclusion

Effective syslog implementation transforms your network from a black box into a transparent, monitorable system. By centralizing logs, implementing proper timestamping, and leveraging modern analysis tools, network administrators gain the visibility needed to maintain robust, secure networks.

Start with basic centralized logging, then gradually enhance your setup with advanced analytics and alerting as your needs grow.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x