- Lab
- A Cloud Guru
Configuring and Managing System Logs in SUSE Linux Enterprise
Log management is a fundamental task that system administrators should be able to perform. The first step on the path to mastery is being able to configure the system to log to the desired locations. In this hands-on lab, we will configure rsyslog to filter certain logs to a location so they can be reviewed.
Path Info
Table of Contents
-
Challenge
Configure rsyslog to Send All `local3` Messages to `/var/log/local3evtx` and All `local5` Messages to `/var/log/local5evtx`
-
Change the configuration of rsyslog to route the
local3
andlocal5
logs:sudo vim /etc/rsyslog.conf
-
Edit the line that contains the reference to the files.
Change:
local2.*;local3.* . -/var/log/localmessages
To:
local2.* -/var/log/localmessages local3.* . -/var/log/local3evtx
And change:
local4.*;local5.* . -/var/log/localmessages
To:
local4.* -/var/log/localmessages local5.* . -/var/log/local5evtx
Save and write the file.
-
Restart rsyslog:
sudo systemctl restart rsyslog
-
-
Challenge
Use the `logger` Command to Verify the Logs Are Being Routed Correctly
-
Confirm the
local3evt
andlocal5evt
files do not exist:ls /var/log
-
Then have rsyslog route messages to the respective files:
sudo logger -p local3.info 'this is a test' sudo logger -p local5.info 'this is a test'
-
Verify the files were both created and contain the test messages:
ls /var/log sudo cat /var/log/local3evtx sudo cat /var/log/local5evtx
-
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.