Build and install
Fluent Bit uses CMake as its build system.
Requirements
To build and install Fluent Bit from source, you must also install the following packages:
bisonbuild-essentialscmake(version 3.31.6 or later)flexlibssl-devlibyaml-devpkg-config
Additionally, certain input or output plugins might depend on additional components. For example, some plugins require Kafka.
Prepare environment
If you already know how CMake works, you can skip this section and review the available build options.
The following steps explain how to build and install the project with the default options.
Change to the
build/directory inside the Fluent Bit sources:cd build/Let CMake configure the project specifying where the root path is located:
cmake ../This command displays a series of results similar to:
-- The C compiler identification is GNU 4.9.2 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- The CXX compiler identification is GNU 4.9.2 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works ... -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Looking for accept4 -- Looking for accept4 - not found -- Configuring done -- Generating done -- Build files have been written to: /home/edsiper/coding/fluent-bit/buildStart the compilation process using the
makecommand:makeThis command displays results similar to:
Scanning dependencies of target msgpack [ 2%] Building C object lib/msgpack-1.1.0/CMakeFiles/msgpack.dir/src/unpack.c.o [ 4%] Building C object lib/msgpack-1.1.0/CMakeFiles/msgpack.dir/src/objectc.c.o [ 7%] Building C object lib/msgpack-1.1.0/CMakeFiles/msgpack.dir/src/version.c.o ... [ 19%] Building C object lib/monkey/mk_core/CMakeFiles/mk_core.dir/mk_file.c.o [ 21%] Building C object lib/monkey/mk_core/CMakeFiles/mk_core.dir/mk_rconf.c.o [ 23%] Building C object lib/monkey/mk_core/CMakeFiles/mk_core.dir/mk_string.c.o ... Scanning dependencies of target fluent-bit-static [ 66%] Building C object src/CMakeFiles/fluent-bit-static.dir/flb_pack.c.o [ 69%] Building C object src/CMakeFiles/fluent-bit-static.dir/flb_input.c.o [ 71%] Building C object src/CMakeFiles/fluent-bit-static.dir/flb_output.c.o ... Linking C executable ../bin/fluent-bit [100%] Built target fluent-bit-binTo continue installing the binary on the system, use
make install:make installIf the command indicates insufficient permissions, prefix the command with
sudo.
Build options
Fluent Bit provides configurable options to CMake that can be enabled or disabled.
General options
FLB_ALL
Enable all features available
No
FLB_ARROW
Build with Apache Arrow support
No
FLB_AVRO_ENCODER
Build with Avro encoding support
No
FLB_AWS
Enable AWS support
Yes
FLB_AWS_ERROR_REPORTER
Build with AWS error reporting support
No
FLB_BENCHMARKS
Enable benchmarks
No
FLB_BINARY
Build executable
Yes
FLB_CHUNK_TRACE
Enable chunk traces
Yes
FLB_COVERAGE
Build with code-coverage
No
FLB_CONFIG_YAML
Enable YAML configuration support
Yes
FLB_CORO_STACK_SIZE
Set coroutine stack size
FLB_CUSTOM_CALYPTIA
Enable Calyptia Support
Yes
FLB_ENFORCE_ALIGNMENT
Enable limited platform specific aligned memory access
No
FLB_EXAMPLES
Build examples
Yes
FLB_HTTP_SERVER
Enable HTTP Server
Yes
FLB_INOTIFY
Enable Inotify support
Yes
FLB_JEMALLOC
Build with Jemalloc support
No
FLB_KAFKA
Enable Kafka support
Yes
FLB_LUAJIT
Enable Lua scripting support
Yes
FLB_METRICS
Enable metrics support
Yes
FLB_MTRACE
Enable mtrace support
No
FLB_PARSER
Build with Parser support
Yes
FLB_POSIX_TLS
Force POSIX thread storage
No
FLB_PROFILES
Enable profiles support
Yes
FLB_PROTOBUF_ENCODER
Build Kafka runtime Protobuf encoding support. Supported in v5.1.3 or later.
No
FLB_PROXY_GO
Enable Go plugins support
Yes
FLB_RECORD_ACCESSOR
Enable record accessor
Yes
FLB_REGEX
Build with Regex support
Yes
FLB_RELEASE
Build with release mode (-O2 -g -DNDEBUG)
No
FLB_SHARED_LIB
Build shared library
Yes
FLB_SIGNV4
Enable AWS Signv4 support
Yes
FLB_SIMD
Enable SIMD support
No
FLB_SQLDB
Enable SQL embedded database support
Yes
FLB_STATIC_CONF
Build binary using static configuration files. The value of this option must be a directory containing configuration files.
FLB_STREAM_PROCESSOR
Enable Stream Processor
Yes
FLB_TLS
Build with SSL/TLS support
Yes
FLB_UNICODE_ENCODER
Build with Unicode (UTF-16LE, UTF-16BE) encoding support
Yes (if C++ compiler found)
FLB_UTF8_ENCODER
Build with UTF8 encoding support
Yes
FLB_WASM
Build with Wasm runtime support
Yes
FLB_WASM_STACK_PROTECT
Build with WASM runtime with strong stack protector flags
No
FLB_WAMRC
Build with Wasm ahead-of-time compiler executable
No
FLB_WINDOWS_DEFAULTS
Build with predefined Windows settings
Yes
FLB_ZIG
Enable zig integration
Yes
FLB_PROTOBUF_ENCODER is available in Fluent Bit version 5.1.3 and greater. Enabling it requires Protobuf 3.12 or greater, including the libprotoc development libraries. If libprotoc is missing, CMake stops with FLB_PROTOBUF_ENCODER requires libprotoc development libraries. This option also adds a C++ source file to the Kafka output plugin and requires C++11, so the build needs a C++ compiler.
The Blob input, Azure Blob and Amazon S3 outputs, and the CheckList filter require FLB_SQLDB. In Fluent Bit version 5.2 and greater, when you set FLB_SQLDB to Off, CMake disables these plugins and prints Disabling <OPTION>: SQL database support is disabled for each plugin it disables. Plugins that are already off, such as FLB_OUT_S3 when you also set it to Off, don't produce the message.
Development options
FLB_BACKTRACE
Enable stack trace support
Yes
FLB_DEBUG
Build with debug mode (-g)
No
FLB_SANITIZE_MEMORY
Enable MemorySanitizer
No
FLB_SANITIZE_THREAD
Enable ThreadSanitizer
No
FLB_SMALL
Optimize for small size
No
FLB_TESTS_INTERNAL
Enable internal tests
No
FLB_TESTS_INTERNAL_FUZZ
Enable internal fuzz tests
No
FLB_TESTS_OSSFUZZ
Enable OSS-Fuzz build
No
FLB_TESTS_RUNTIME
Enable runtime tests
No
FLB_TRACE
Enable trace mode
No
FLB_VALGRIND
Enable Valgrind support
No
FLB_SANITIZE_MEMORY and FLB_SANITIZE_THREAD are available in Fluent Bit version 5.2 and greater. They're aliases for the SANITIZE_MEMORY and SANITIZE_THREAD options, which remain supported. MemorySanitizer requires a compiler with MemorySanitizer support on 64-bit Linux. ThreadSanitizer requires a compiler with ThreadSanitizer support on 64-bit Linux or macOS. If the compiler doesn't support the requested sanitizer, CMake stops with an error instead of building without the sanitizer. The two sanitizers can't be enabled together in one CMake build: CMake stops with ThreadSanitizer is not compatible with MemorySanitizer. To use both, configure a separate build for each sanitizer.
Optimization options
FLB_MSGPACK_TO_JSON_INIT_BUFFER_SIZE
Determine initial buffer size for msgpack to json conversion in terms of memory used by payload.
2.0
FLB_MSGPACK_TO_JSON_REALLOC_BUFFER_SIZE
Determine percentage of reallocation size when msgpack to json conversion buffer runs out of memory.
0.1
Input plugins
Input plugins gather information from a specific source type like network interfaces, some built-in metrics, or through a specific input device.
The following input plugins are available:
FLB_IN_WINDOWS_EXPORTER_METRICS is Off by default. When you build on Windows with FLB_WINDOWS_DEFAULTS enabled, it's On, unless you also enable FLB_MINIMAL, which keeps the default Off. You can still override it. This behavior is available in Fluent Bit version 5.1.4 and greater.
Processor plugins
Processor plugins handle the events within the processor pipelines to allow modifying, enriching, or dropping events.
The following table describes the processors available:
Filter plugins
Filter plugins let you modify, enrich or drop records.
The following table describes the filters available on this version:
Output plugins
Output plugins let you flush the information to some external interface, service, or terminal.
The following table describes the output plugins available. FLB_OUT_ARVANCLOUD_CLOUDLOGS is available in Fluent Bit version 5.1.3 and greater.
FLB_OUT_LIB
Enable Library output plugin
On
Last updated
Was this helpful?