# Build and install

[Fluent Bit](http://fluentbit.io) uses [CMake](http://cmake.org) as its build system.

## Requirements

* CMake 3.12 or greater. You might need to use `cmake3` instead of `cmake`.
* Flex
* Bison 3 or greater
* YAML headers
* OpenSSL headers

## Prepare environment

If you already know how CMake works, you can skip this section and review the available [build options](#general-options).

The following steps explain how to build and install the project with the default options.

1. Change to the `build/` directory inside the Fluent Bit sources:

   ```shell
   cd build/
   ```
2. Let [CMake](http://cmake.org) configure the project specifying where the root path is located:

   ```shell
   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/build
   ```
3. Start the compilation process using the `make` command:

   ```shell
   make
   ```

   This 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-bin
   ```
4. To continue installing the binary on the system, use `make install`:

   ```shell
   make install
   ```

   If 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

| Option                 | Description                                                                                                                 | Default |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------- |
| `FLB_ALL`              | Enable all features available                                                                                               | `No`    |
| `FLB_JEMALLOC`         | Use Jemalloc as default memory allocator                                                                                    | `No`    |
| `FLB_TLS`              | Build with SSL/TLS support                                                                                                  | `Yes`   |
| `FLB_BINARY`           | Build executable                                                                                                            | `Yes`   |
| `FLB_EXAMPLES`         | Build examples                                                                                                              | `Yes`   |
| `FLB_SHARED_LIB`       | Build shared library                                                                                                        | `Yes`   |
| `FLB_MTRACE`           | Enable `mtrace` support                                                                                                     | `No`    |
| `FLB_INOTIFY`          | Enable Inotify support                                                                                                      | `Yes`   |
| `FLB_POSIX_TLS`        | Force POSIX thread storage                                                                                                  | `No`    |
| `FLB_SQLDB`            | Enable SQL embedded database support                                                                                        | `No`    |
| `FLB_HTTP_SERVER`      | Enable HTTP Server                                                                                                          | `No`    |
| `FLB_LUAJIT`           | Enable Lua scripting support                                                                                                | `Yes`   |
| `FLB_RECORD_ACCESSOR`  | Enable record accessor                                                                                                      | `Yes`   |
| `FLB_SIGNV4`           | Enable AWS Signv4 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_CONFIG_YAML`      | Enable YAML configuration support                                                                                           | `Yes`   |
| `FLB_WASM`             | Build with Wasm runtime support                                                                                             | `Yes`   |
| `FLB_WAMRC`            | Build with Wasm AOT compiler executable                                                                                     | `No`    |

### Development options

| Option               | Description                         | Default |
| -------------------- | ----------------------------------- | ------- |
| `FLB_DEBUG`          | Build binaries with debug symbols   | `No`    |
| `FLB_VALGRIND`       | Enable `Valgrind` support           | `No`    |
| `FLB_TRACE`          | Enable trace mode                   | `No`    |
| `FLB_SMALL`          | Minimise binary size                | `No`    |
| `FLB_TESTS_RUNTIME`  | Enable runtime tests                | `No`    |
| `FLB_TESTS_INTERNAL` | Enable internal tests               | `No`    |
| `FLB_TESTS`          | Enable tests                        | `No`    |
| `FLB_BACKTRACE`      | Enable backtrace/stacktrace support | `Yes`   |

### Optimization options

| Option                                    | Description                                                                                              | Default |
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------- |
| `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:

| Option                                                                                | Description                                                               | Default |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------- |
| [`FLB_IN_COLLECTD`](/manual/4.0/data-pipeline/inputs/collectd.md)                     | Enable Collectd input plugin                                              | `On`    |
| [`FLB_IN_CPU`](/manual/4.0/data-pipeline/inputs/cpu-metrics.md)                       | Enable CPU input plugin                                                   | `On`    |
| [`FLB_IN_DISK`](/manual/4.0/data-pipeline/inputs/disk-io-metrics.md)                  | Enable Disk I/O Metrics input plugin                                      | `On`    |
| [`FLB_IN_DOCKER`](/manual/4.0/data-pipeline/inputs/docker-events.md)                  | Enable Docker metrics input plugin                                        | `On`    |
| [`FLB_IN_EXEC`](/manual/4.0/data-pipeline/inputs/exec.md)                             | Enable Exec input plugin                                                  | `On`    |
| [`FLB_IN_EXEC_WASI`](/manual/4.0/data-pipeline/inputs/exec-wasi.md)                   | Enable Exec WASI input plugin                                             | `On`    |
| [`FLB_IN_FLUENTBIT_METRICS`](/manual/4.0/data-pipeline/inputs/fluentbit-metrics.md)   | Enable Fluent Bit metrics input plugin                                    | `On`    |
| [`FLB_IN_ELASTICSEARCH`](/manual/4.0/data-pipeline/inputs/elasticsearch.md)           | Enable Elasticsearch/OpenSearch Bulk input plugin                         | `On`    |
| [`FLB_IN_FORWARD`](/manual/4.0/data-pipeline/inputs/forward.md)                       | Enable Forward input plugin                                               | `On`    |
| [`FLB_IN_HEAD`](/manual/4.0/data-pipeline/inputs/head.md)                             | Enable Head input plugin                                                  | `On`    |
| [`FLB_IN_HEALTH`](/manual/4.0/data-pipeline/inputs/health.md)                         | Enable Health input plugin                                                | `On`    |
| [`FLB_IN_KMSG`](/manual/4.0/data-pipeline/inputs/kernel-logs.md)                      | Enable Kernel log input plugin                                            | `On`    |
| [`FLB_IN_MEM`](/manual/4.0/data-pipeline/inputs/memory-metrics.md)                    | Enable Memory input plugin                                                | `On`    |
| [`FLB_IN_MQTT`](/manual/4.0/data-pipeline/inputs/mqtt.md)                             | Enable MQTT Server input plugin                                           | `On`    |
| [`FLB_IN_NETIF`](/manual/4.0/data-pipeline/inputs/network-io-metrics.md)              | Enable Network I/O metrics input plugin                                   | `On`    |
| [`FLB_IN_PROC`](/manual/4.0/data-pipeline/inputs/process.md)                          | Enable Process monitoring input plugin                                    | `On`    |
| [`FLB_IN_RANDOM`](/manual/4.0/data-pipeline/inputs/random.md)                         | Enable Random input plugin                                                | `On`    |
| [`FLB_IN_SERIAL`](/manual/4.0/data-pipeline/inputs/serial-interface.md)               | Enable Serial input plugin                                                | `On`    |
| [`FLB_IN_STDIN`](/manual/4.0/data-pipeline/inputs/standard-input.md)                  | Enable Standard input plugin                                              | `On`    |
| [`FLB_IN_SYSLOG`](/manual/4.0/data-pipeline/inputs/syslog.md)                         | Enable Syslog input plugin                                                | `On`    |
| [`FLB_IN_SYSTEMD`](/manual/4.0/data-pipeline/inputs/systemd.md)                       | Enable Systemd / Journald input plugin                                    | `On`    |
| [`FLB_IN_TAIL`](/manual/4.0/data-pipeline/inputs/tail.md)                             | Enable Tail (follow files) input plugin                                   | `On`    |
| [`FLB_IN_TCP`](/manual/4.0/data-pipeline/inputs/tcp.md)                               | Enable TCP input plugin                                                   | `On`    |
| [`FLB_IN_THERMAL`](/manual/4.0/data-pipeline/inputs/thermal.md)                       | Enable system temperature input plugin                                    | `On`    |
| [`FLB_IN_UDP`](/manual/4.0/data-pipeline/inputs/udp.md)                               | Enable UDP input plugin                                                   | `On`    |
| [`FLB_IN_WINLOG`](/manual/4.0/data-pipeline/inputs/windows-event-log.md)              | Enable Windows Event Log input plugin (Windows Only)                      | `On`    |
| [`FLB_IN_WINEVTLOG`](/manual/4.0/data-pipeline/inputs/windows-event-log-winevtlog.md) | Enable Windows Event Log input plugin using `winevt.h` API (Windows Only) | `On`    |

### Filter plugins

Filter plugins let you modify, enrich or drop records. The following table describes the filters available on this version:

| Option                                                                               | Description                       | Default |
| ------------------------------------------------------------------------------------ | --------------------------------- | ------- |
| [`FLB_FILTER_AWS`](/manual/4.0/data-pipeline/filters/aws-metadata.md)                | Enable AWS metadata filter        | `On`    |
| [`FLB_FILTER_ECS`](/manual/4.0/data-pipeline/filters/ecs-metadata.md)                | Enable AWS metadata filter        | `On`    |
| `FLB_FILTER_EXPECT`                                                                  | Enable Expect data test filter    | `On`    |
| [`FLB_FILTER_GREP`](/manual/4.0/data-pipeline/filters/grep.md)                       | Enable Grep filter                | `On`    |
| [`FLB_FILTER_KUBERNETES`](/manual/4.0/data-pipeline/filters/kubernetes.md)           | Enable Kubernetes metadata filter | `On`    |
| [`FLB_FILTER_LUA`](/manual/4.0/data-pipeline/filters/lua.md)                         | Enable Lua scripting filter       | `On`    |
| [`FLB_FILTER_MODIFY`](/manual/4.0/data-pipeline/filters/modify.md)                   | Enable Modify filter              | `On`    |
| [`FLB_FILTER_NEST`](/manual/4.0/data-pipeline/filters/nest.md)                       | Enable Nest filter                | `On`    |
| [`FLB_FILTER_PARSER`](/manual/4.0/data-pipeline/filters/parser.md)                   | Enable Parser filter              | `On`    |
| [`FLB_FILTER_RECORD_MODIFIER`](/manual/4.0/data-pipeline/filters/record-modifier.md) | Enable Record Modifier filter     | `On`    |
| [`FLB_FILTER_REWRITE_TAG`](/manual/4.0/data-pipeline/filters/rewrite-tag.md)         | Enable Rewrite Tag filter         | `On`    |
| [`FLB_FILTER_STDOUT`](/manual/4.0/data-pipeline/filters/standard-output.md)          | Enable Stdout filter              | `On`    |
| [`FLB_FILTER_SYSINFO`](/manual/4.0/data-pipeline/filters/sysinfo.md)                 | Enable Sysinfo filter             | `On`    |
| [`FLB_FILTER_THROTTLE`](/manual/4.0/data-pipeline/filters/throttle.md)               | Enable Throttle filter            | `On`    |
| [`FLB_FILTER_TYPE_CONVERTER`](/manual/4.0/data-pipeline/filters/type-converter.md)   | Enable Type Converter filter      | `On`    |
| [`FLB_FILTER_WASM`](/manual/4.0/data-pipeline/filters/wasm.md)                       | Enable Wasm filter                | `On`    |

### Output plugins

Output plugins let you flush the information to some external interface, service, or terminal. The following table describes the output plugins available:

| Option                                                                             | Description                                                       | Default |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------- |
| [`FLB_OUT_AZURE`](/manual/4.0/data-pipeline/outputs/azure.md)                      | Enable Microsoft Azure output plugin                              | `On`    |
| [`FLB_OUT_AZURE_KUSTO`](/manual/4.0/data-pipeline/outputs/azure_kusto.md)          | Enable Azure Kusto output plugin                                  | `On`    |
| [`FLB_OUT_BIGQUERY`](/manual/4.0/data-pipeline/outputs/bigquery.md)                | Enable Google BigQuery output plugin                              | `On`    |
| [`FLB_OUT_COUNTER`](/manual/4.0/data-pipeline/outputs/counter.md)                  | Enable Counter output plugin                                      | `On`    |
| [`FLB_OUT_CLOUDWATCH_LOGS`](/manual/4.0/data-pipeline/outputs/cloudwatch.md)       | Enable Amazon CloudWatch output plugin                            | `On`    |
| [`FLB_OUT_DATADOG`](/manual/4.0/data-pipeline/outputs/datadog.md)                  | Enable Datadog output plugin                                      | `On`    |
| [`FLB_OUT_ES`](/manual/4.0/data-pipeline/outputs/elasticsearch.md)                 | Enable [Elastic Search](http://www.elastic.co) output plugin      | `On`    |
| [`FLB_OUT_FILE`](/manual/4.0/data-pipeline/outputs/file.md)                        | Enable File output plugin                                         | `On`    |
| [`FLB_OUT_KINESIS_FIREHOSE`](/manual/4.0/data-pipeline/outputs/firehose.md)        | Enable Amazon Kinesis Data Firehose output plugin                 | `On`    |
| [`FLB_OUT_KINESIS_STREAMS`](/manual/4.0/data-pipeline/outputs/kinesis.md)          | Enable Amazon Kinesis Data Streams output plugin                  | `On`    |
| [`FLB_OUT_FLOWCOUNTER`](/manual/4.0/data-pipeline/outputs/flowcounter.md)          | Enable Flow counter output plugin                                 | `On`    |
| [`FLB_OUT_FORWARD`](/manual/4.0/data-pipeline/outputs/forward.md)                  | Enable [Fluentd](http://www.fluentd.org) output plugin            | `On`    |
| [`FLB_OUT_GELF`](/manual/4.0/data-pipeline/outputs/gelf.md)                        | Enable GELF output plugin                                         | `On`    |
| [`FLB_OUT_HTTP`](/manual/4.0/data-pipeline/outputs/http.md)                        | Enable HTTP output plugin                                         | `On`    |
| [`FLB_OUT_INFLUXDB`](/manual/4.0/data-pipeline/outputs/influxdb.md)                | Enable InfluxDB output plugin                                     | `On`    |
| [`FLB_OUT_KAFKA`](/manual/4.0/data-pipeline/outputs/kafka.md)                      | Enable Kafka output                                               | Off     |
| [`FLB_OUT_KAFKA_REST`](/manual/4.0/data-pipeline/outputs/kafka-rest-proxy.md)      | Enable Kafka REST Proxy output plugin                             | `On`    |
| `FLB_OUT_LIB`                                                                      | Enable Lib output plugin                                          | `On`    |
| [`FLB_OUT_NATS`](/manual/4.0/data-pipeline/outputs/nats.md)                        | Enable [NATS](http://www.nats.io) output plugin                   | `On`    |
| `FLB_OUT_NULL`                                                                     | Enable `NULL` output plugin                                       | `On`    |
| `FLB_OUT_PGSQL`                                                                    | Enable PostgreSQL output plugin                                   | `On`    |
| `FLB_OUT_PLOT`                                                                     | Enable Plot output plugin                                         | `On`    |
| `FLB_OUT_SLACK`                                                                    | Enable Slack output plugin                                        | `On`    |
| [`FLB_OUT_S3`](/manual/4.0/data-pipeline/outputs/s3.md)                            | Enable Amazon S3 output plugin                                    | `On`    |
| [`FLB_OUT_SPLUNK`](/manual/4.0/data-pipeline/outputs/splunk.md)                    | Enable Splunk output plugin                                       | `On`    |
| [`FLB_OUT_STACKDRIVER`](/manual/4.0/data-pipeline/outputs/stackdriver.md)          | Enable Google Stackdriver output plugin                           | `On`    |
| [`FLB_OUT_STDOUT`](/manual/4.0/installation/downloads/source/build-and-install.md) | Enable STDOUT output plugin                                       | `On`    |
| `FLB_OUT_TCP`                                                                      | Enable TCP/TLS output plugin                                      | `On`    |
| [`FLB_OUT_TD`](/manual/4.0/data-pipeline/outputs/treasure-data.md)                 | Enable [Treasure Data](http://www.treasuredata.com) output plugin | `On`    |

### 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:

| Option                                                                                       | Description                                 | Default |
| -------------------------------------------------------------------------------------------- | ------------------------------------------- | ------- |
| [`FLB_PROCESSOR_METRICS_SELECTOR`](/manual/4.0/data-pipeline/processors/metrics-selector.md) | Enable metrics selector processor           | `On`    |
| [`FLB_PROCESSOR_LABELS`](/manual/4.0/data-pipeline/processors/labels.md)                     | Enable metrics label manipulation processor | `On`    |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fluentbit.io/manual/4.0/installation/downloads/source/build-and-install.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
