6 Parsing to extract more meaning

 

This chapter covers

  • Exploring the relationship between filters, parsers, and decoders
  • Examining prebuilt parsers
  • Using filters to run parser processes
  • Using regular expressions and JSON parsers to extract meaning from log content

In this chapter, we will start working with Fluent Bit’s capabilities to examine and manipulate the data it collects and outputs. Parsers are key tools for extracting meaning from unstructured data. Obtaining the meaning of an event allows us to make decisions and transform and route events. To use an old expression, parsing enables us to turn data into information.

6.1 Architectural context

As we can see in figure 6.1, parsers and filters sit in the middle of the pipeline of processing log events after we’ve ingested the data.

Figure 6.1 Logical architecture of Fluent Bit, with this chapter's focus on parsers highlighted. Parsers are used in special cases with input plugins but primarily through their relationship with filters.
figure

The benefit of separating parsers from the input and output plugins is that we can apply the same parsing processes to different sources. This makes parsers highly reusable, as we’ll see. As the figure suggests, we can use parsers with input plugins, but the main relationship parsers have with other components is with filters, as we’ll see.

6.2 The goal of parsing

6.3 Relationship between parsers and filters

6.4 Prebuilt parsers

6.5 Parsing an Apache log file

6.6 Multiline parsing

6.7 Custom parsing

6.8 Processing JSON

6.8.1 Changing the log event timestamp

6.8.2 Diagnosing the unhappy paths

6.9 Other types of parsers

6.9.1 logfmt

6.9.2 LTSV

6.10 Decoders