Skip to content

Best 100 Tools

Best 100 Tools – Independent Software Reviews by Administrators… for Administrators

Primary Menu
  • Home
  • Best 100 Tools
  • 7 System Logging Configurations with rsyslog
  • Best 100 Tools

7 System Logging Configurations with rsyslog

Paul September 12, 2025
7-System-Logging-Configurations-with-rsyslog-1

System Logging Configurations with Rsyslog

Rsyslog is a reliable and feature-rich system logging daemon that can be used to collect log messages from various sources, including devices, applications, and services. In this article, we will explore 7 common system logging configurations that can be achieved using rsyslog.

1. Basic Configuration

A basic configuration of rsyslog involves specifying the input source (e.g., kernel logs, user-space logs), configuring a log file for each type of message, and setting up a rotation policy to manage log file size.

/etc/rsyslog.conf

“`markdown

File created by default by rsyslog package

If you want to use a different name, be aware that it must end in “.conf”

First some definitions which our configuration relies on.

module(load=”imuxsock”) # creates shoebox for kernel logger and user-space logs
module(load=”imklog” ) # reads kernel messages from /proc/kmsg (all kernel output!)

This tells rsyslog to start up with the default settings, just like before

-i 0 means that we are not looking for remote connections

Start all available modules, by default they are set to enabled.

$ModLoad imuxsock # creates shoebox for kernel logger and user-space logs
$ModLoad imklog # reads kernel messages from /proc/kmsg (all kernel output!)

Accept messages from local console (e.g. klogd), even if the system

has no console users. This will save disk space on busy systems.

$ModLoad imuxsock

Enable some input modules that are not enabled by default

$ModLoad imklog # reads kernel messages from /proc/kmsg (all kernel output!)

Include all config files in /etc/rsyslog.d/

include_file /etc/rsyslog.d/*.conf
“`

2. Centralized Logging

In a centralized logging configuration, logs are collected from multiple hosts and stored on a central server. This setup is useful for monitoring large-scale systems where log analysis is necessary.

Host Configuration

On each host:

“`markdown

/etc/rsyslog.conf

$ModLoad imuxsock # creates shoebox for kernel logger and user-space logs
$ModLoad imklog # reads kernel messages from /proc/kmsg (all kernel output!)
$FileRSYSLOGD-9999
.;*.=debug;\
file=”/var/log/syslog-host” # Log to this host-specific log file
“`

Central Server Configuration

On the central server:

“`markdown

/etc/rsyslog.conf

Accept messages from all hosts, even if they are not running rsyslogd.

.;*.=debug;\
file=”/var/log/syslog-central”
“`

3. Remote Logging

In a remote logging configuration, logs are collected from multiple hosts and forwarded to a central server over the network.

Host Configuration

On each host:

“`markdown

/etc/rsyslog.conf

$ModLoad imuxsock # creates shoebox for kernel logger and user-space logs
$ModLoad imklog # reads kernel messages from /proc/kmsg (all kernel output!)
.;*.=debug;\
@127.0.0.1:514
“`

Central Server Configuration

On the central server:

“`markdown

/etc/rsyslog.conf

Accept messages from all hosts, even if they are not running rsyslogd.

$ModLoad imudp # reads UDP messages on port 514 (default for remote logging)
$InputUDPAddr @127.0.0.1:514
.;*.=debug;\
file=”/var/log/syslog-central”
“`

4. Rotating Logs

Rsyslog can be configured to rotate logs based on size, time, or other criteria.

Configuration

“`markdown

/etc/rsyslog.conf

$ModLoad imuxsock # creates shoebox for kernel logger and user-space logs
$ModLoad imklog # reads kernel messages from /proc/kmsg (all kernel output!)
.;*.=debug;\
file=”/var/log/syslog-host”
size 10M # Rotate log files when they reach this size
“`

5. Disk Space Monitoring

Rsyslog can be configured to monitor disk space and alert when it reaches a critical level.

Configuration

“`markdown

/etc/rsyslog.conf

$ModLoad imuxsock # creates shoebox for kernel logger and user-space logs
$ModLoad imklog # reads kernel messages from /proc/kmsg (all kernel output!)
.;*.=debug;\
file=”/var/log/syslog-host”
size 10M # Rotate log files when they reach this size

Monitor disk space on all filesystems.

$ModLoad impolicy # enable policy module
$InputPolicy path / # scan filesystem paths for changes
path /var/log # monitor this directory for new files
“`

6. Alerting

Rsyslog can be configured to alert administrators when certain conditions are met.

Configuration

“`markdown

/etc/rsyslog.conf

$ModLoad imuxsock # creates shoebox for kernel logger and user-space logs
$ModLoad imklog # reads kernel messages from /proc/kmsg (all kernel output!)
.;*.=debug;\
file=”/var/log/syslog-host”

Alert administrators when disk space reaches a critical level.

.;*.=debug;\
action(type=”omuser” user=root \
msgstring=”Disk space is critically low.”)
“`

7. Filtering

Rsyslog can be configured to filter out unwanted messages.

Configuration

“`markdown

/etc/rsyslog.conf

$ModLoad imuxsock # creates shoebox for kernel logger and user-space logs
$ModLoad imklog # reads kernel messages from /proc/kmsg (all kernel output!)
.;*.=debug;\
file=”/var/log/syslog-host”
level warn # Only log messages at or above the specified level

Filter out debug messages.

.;*.=debug;\
stop
“`

In this article, we have explored 7 common system logging configurations that can be achieved using rsyslog. These include basic configuration, centralized logging, remote logging, rotating logs, disk space monitoring, alerting, and filtering. By understanding these configurations, system administrators can effectively monitor their systems and ensure that log messages are properly collected, stored, and analyzed.

About the Author

Paul

Administrator

Visit Website View All Posts
Post Views: 49

Post navigation

Previous: 8 Emerging DevOps Tools for Development Teams
Next: 25 SSH Key Authentication Implementation Techniques

Related Stories

17-ELK-Stack-Configurations-for-System-Monitoring-1
  • Best 100 Tools

17 ELK Stack Configurations for System Monitoring

Paul September 28, 2025
13-Ubuntu-Performance-Optimization-Techniques-1
  • Best 100 Tools

13 Ubuntu Performance Optimization Techniques

Paul September 27, 2025
20-Fail2Ban-Configurations-for-Enhanced-Security-1
  • Best 100 Tools

20 Fail2Ban Configurations for Enhanced Security

Paul September 26, 2025

Recent Posts

  • 17 ELK Stack Configurations for System Monitoring
  • 13 Ubuntu Performance Optimization Techniques
  • 20 Fail2Ban Configurations for Enhanced Security
  • 5 AWS CI/CD Pipeline Implementation Strategies
  • 13 System Logging Configurations with rsyslog

Recent Comments

  • sysop on Notepadqq – a good little editor!
  • rajvir samrai on Steam – A must for gamers

Categories

  • AI & Machine Learning Tools
  • Aptana Studio
  • Automation Tools
  • Best 100 Tools
  • Cloud Backup Services
  • Cloud Computing Platforms
  • Cloud Hosting
  • Cloud Storage Providers
  • Cloud Storage Services
  • Code Editors
  • Dropbox
  • Eclipse
  • HxD
  • Notepad++
  • Notepadqq
  • Operating Systems
  • Security & Privacy Software
  • SHAREX
  • Steam
  • Superpower
  • The best category for this post is:
  • Ubuntu
  • Unreal Engine 4

You may have missed

17-ELK-Stack-Configurations-for-System-Monitoring-1
  • Best 100 Tools

17 ELK Stack Configurations for System Monitoring

Paul September 28, 2025
13-Ubuntu-Performance-Optimization-Techniques-1
  • Best 100 Tools

13 Ubuntu Performance Optimization Techniques

Paul September 27, 2025
20-Fail2Ban-Configurations-for-Enhanced-Security-1
  • Best 100 Tools

20 Fail2Ban Configurations for Enhanced Security

Paul September 26, 2025
5-AWS-CICD-Pipeline-Implementation-Strategies-1
  • Best 100 Tools

5 AWS CI/CD Pipeline Implementation Strategies

Paul September 25, 2025
Copyright © All rights reserved. | MoreNews by AF themes.