Configuring and Managing System Logs in SUSE Linux Enterprise

15 minutes
  • 2 Learning Objectives

About this Hands-on Lab

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.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Configure rsyslog to Send All `local3` Messages to `/var/log/local3evtx` and All `local5` Messages to `/var/log/local5evtx`
  1. Change the configuration of rsyslog to route the local3 and local5 logs:

    sudo vim /etc/rsyslog.conf
  2. Edit the line that contains the reference to the files.


    local2.*;local3.* . -/var/log/localmessages


    local2.*   -/var/log/localmessages
    local3.* . -/var/log/local3evtx

    And change:

    local4.*;local5.* . -/var/log/localmessages


    local4.*   -/var/log/localmessages
    local5.* . -/var/log/local5evtx

    Save and write the file.

  3. Restart rsyslog:

    sudo systemctl restart rsyslog
Use the `logger` Command to Verify the Logs Are Being Routed Correctly
  1. Confirm the local3evt and local5evt files do not exist:

    ls /var/log
  2. Then have rsyslog route messages to the respective files:

    sudo logger -p 'this is a test'
    sudo logger -p 'this is a test'
  3. Verify the files were both created and contain the test messages:

    ls /var/log
    sudo cat /var/log/local3evtx
    sudo cat /var/log/local5evtx

Additional Resources

Your system has an issue that needs to be investigated. You have been asked to configure logging so the events can be reivewed when the issue occurs again. You will need to:

  • Configure local3 messages to route to /var/log/local3evts.
  • Configure local5 messages to route to /var/log/local5evts.

Once this is done, you will need to verify the logging scheme is implemented correctly.

What are Hands-on Labs

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.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?