Use the Include Directive in Fluentd

30 minutes
  • 4 Learning Objectives

About this Hands-on Lab

In this lab, you have been provided with a Linux server that has Fluentd preinstalled. This Fluentd has been configured as a standard Fluentd installation. Two files are provided that will read the `/var/log/messages` and will send new contents of that log to the td-agent stdout. Your task is to take the two provided files and use the `include` option to add them to the Fluentd configuration file so they will be read when Fluentd is restarted. Then you will need to test to ensure it is working and sending the contents of the `/var/log/messages` log to the Fluentd log.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Log In to the Provided Server

Log in to the server as cloud_user with the provided password to ensure you can log in. When the file SERVER-READY is shown in the /home/cloud_user folder, then you can follow along with the tasks.

Use the Two Provided Files and Add Them to the Configuration

There are two provided files that have separate portions of a configuration that will send new content for the /var/log/messages log into the Fluentd stdout.

Use whatever method is required to include those files into the /etc/td-agent/td-agent.conf configuration file.

The files are called /etc/td-agent/messages-source-include.conf and /etc/td-agent/messages-match-include.conf.

Start the td-agent via the CLI

Use whatever command is required to have td-agent read the /etc/td-agent/td-agent.conf configuration file and run the commands inside.

Test the Changes Have Worked

Test that the changes have worked, and ensure that any new entries to the /var/log/messages are now being sent to the td-agent stdout.

The logger command can be used to send messages to /var/log/messages.

Additional Resources

You have been told that there is a method that will allow you to use pre-made configuration files and have them read into the Fluentd configuration without having to add the contents of those files.

Your task is to take those two provided configuration files and do what is required to have those files read in the correct order and used by the Fluentd installation.

The two files are:

  • /etc/td-agent/messages-source-include.conf
  • /etc/td-agent/messages-match-include.conf

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?