2 From zero to “Hello, World”

 

This chapter covers

  • Learning ways to configure Fluent Bit
  • Examining the 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 getting Fluent Bit up and running with a scenario, we’ll be quicker than Nic Cage in Gone in 60 Seconds. Although the chapter will take you a little longer to read than others, we’ll certainly have the Fluent Bit equivalent to the developer’s “Hello, World” going with minimal effort. Understanding different configuration approaches and the ways they can be dynamic means you can decide which approach best fits your deployment needs.

For this chapter, all we need are Fluent Bit and a tool of our choice to edit configuration files, such as Visual Studio Code. If the tool can understand YAML (YAML Ain’t Markup Language), that’s a bonus. All the instructions for installing Fluent Bit are provided in appendix A.

The content relating only to v3 has been explicitly called out. The core capabilities described will work all the way back to Fluent Bit v1, but the console output differs slightly.

2.1 Multiple ways to configure Fluent Bit

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 a dry run

2.3.1 Exercise: Using - -dry-run to help fix a conf file

2.4 Configuring file inclusions

2.4.1 Creating 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