Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Chapter 11 | Analyzing and Storing Logs

Guided Exercise

Reviewing Syslog Files


In this exercise, you will reconfigure to write specific log messages to a new file.

Outcomes
You should be able to configure the service to write all log messages with the
priority to the log file.

Before You Begin


Log in to as using as the password.

On , run to start the exercise. This script


ensures that the environment is setup correctly.

1. From , open an SSH session to as .

2. Configure on to log all messages with the priority, or higher, for


any service into the new log file by adding the
configuration file .

2.1. Use the command to switch to the user. Specify as the


password for the user if asked while running the command.

2.2. Create the file with the necessary entries to


redirect all log messages having the priority to
. You may use the command to create
the file with the following content.

This configuration line catches syslog messages with any facility and a or
above priority level. The service will write the matching messages to the
file. The wildcard ( ) in the or
fields of the configuration line indicates any facility or priority.

2.3. Restart the service.

RH199-RHEL8.2-en-1-20200928
Chapter 11 | Analyzing and Storing Logs

3. Verify that all the log messages with the priority appears in the
file.

3.1. Use the command with the option to generate a log message with the
facility and the priority.

3.2. Use the command to view the last ten log messages from the
file and confirm that you see the
message among the other log messages.

3.3. Exit both the and users' shells on to return to the


user's shell on .

Finish
On , run to complete this exercise. This script
ensures that the environment is restored back to the clean state.

This concludes the guided exercise.

RH199-RHEL8.2-en-1-20200928

You might also like