chapter two

2 From Zero to Hello World

 

This chapter covers

  • The different ways for configuring Fluent Bit
  • Examining the different Fluent Bit Command Line Interface (CLI)
  • Creating a Fluent Bit version of Hello World
  • Looking at classic and YAML Fluent Bit configurations
  • Working with dynamic configuration features.

When it comes to Fluent Bit up and running with a scenario, we’ll be quicker than Nic Cage in Gone in 60 seconds; although the chapter might take a little longer to read, we’ll certainly have the Fluent Bit equivalent to the developer’s ‘Hello world’ going with minimal effort. Understanding different configuration approaches and how they can be dynamic will mean you can decide which approach best fits your deployment needs.

For this chapter, all we need is Fluent Bit and a tool of your choice to edit configuration files such as Visual Studio Code. If the tool can understand YAML, that is a bonus. All the instructions to install Fluent Bit are provided in Appendix A.

2.1 Multiple ways to run Fluent Bit

Fluent Bit allows us to provide configurations in multiple ways – through the command line or several different file formats. Before examining how to configure Fluent Bit, we need to take a moment to understand the different options and how we will address them in the book.

2.1.1 Configuration formats

2.1.2 CLI controls

2.1.3 Defining a monitoring pipeline using the CLI

2.1.4 Fluent Bit Prebuilt Docker Container

2.2 Fluent Bit configuration in two forms

2.2.1 Fluent Bit vs. Fluentd configuration comparison

2.2.2 Comparing Classic and YAML configuration

2.3 Checking configuration with dry run

2.3.1 Exercise – using the dry run to help fix a conf file

2.4 Configuring file inclusions

2.4.1 Dynamic configuration by using inclusions

2.4.2 Proving stub inclusions

2.5 Environment variables in the configuration

2.5.1 Applying environment variables

2.5.2 Setting environment variables

2.6 Monitoring Fluent Bit’s health

2.7 Summary