> For the complete documentation index, see [llms.txt](https://docs.fluentbit.io/manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting.md).

# Fluent Typed Scripting (FTS)

{% hint style="info" %}
**Supported event types:** `logs`, `metrics`, `traces`
{% endhint %}

Fluent Typed Scripting (FTS) lets you write policies in Lua with typed access to telemetry. Its configuration name is `fts`. Use it to redact structured fields, normalize log content and OpenTelemetry context, transform metric families, or edit spans.

*Typed* refers to the telemetry values exposed to the policy, including maps, arrays, binary data, exact 64-bit integers, and nanosecond timestamps. FTS doesn't add static typing to Lua. Type checks happen at runtime.

## Availability

FTS is included in the development source for Fluent Bit 5.2.0 and hasn't shipped in a stable release yet. It isn't included in the 5.1 release series. Use a development build with FTS enabled; don't assume a container tagged `latest` includes it. These pages describe the current implementation on `master`. Check your binary with `fluent-bit --version` and run the [quickstart](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/quickstart.md) to confirm that it contains `fts`.

For a native source build, enable `FLB_PROCESSOR_FTS`, `FLB_LUAJIT`, and `FLB_YYJSON`. FTS defaults to interpreted execution even when built with LuaJIT. See [Build and install](https://docs.fluentbit.io/manual/dev-5.2/installation/downloads/source/build-and-install.md) for general build instructions.

The experimental browser WASM profile also includes FTS when `FLB_WASM_LUA=ON`, the profile default. It uses portable Lua 5.4 and rejects `jit: true`. Setting `FLB_WASM_LUA=OFF` disables both FTS and the Lua filter in that profile. This experimental profile is separate from native support and from the [Wasm filter](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/filters/wasm.md).

## Choose FTS

Choose FTS when a transformation needs typed values, per-item rollback, or programmable access to logs, metrics, and traces. Prefer a dedicated processor when its existing operations meet your needs. For an existing Lua filter policy, review [FTS and the Lua filter](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/lua-filter.md) before migrating: their callback and value models differ.

Each signal uses its own processor entry and script under `processors.logs`, `processors.metrics`, or `processors.traces`. A callback receives one log record, one metric family, or one span, respectively. Each processor instance has its own Lua state. FTS doesn't join signals or share globals between those instances.

Processors require [YAML configuration](https://docs.fluentbit.io/manual/dev-5.2/administration/configuring-fluent-bit/yaml.md). Attach FTS to an input or output and place it in the order in which transformations should run. See [Processors](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors.md) for pipeline placement.

## Get started and reference

1. Run your first transformation with the [Quickstart](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/quickstart.md).
2. Configure the policy and execution limits with [Configuration](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/configuration.md).
3. Learn the value model in [Typed values](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/typed-values.md).
4. Use the signal references for [Logs](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/logs.md), [Metrics](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/metrics.md), and [Traces](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/traces.md).
5. Look up [Common helpers](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/common-helpers.md) and [Errors and limits](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/errors-and-limits.md).
6. Adapt the complete [Recipes](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/recipes.md).
7. Configure built-in blocks without Lua by using [Native recipe blocks](https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting/native-recipes.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fluentbit.io/manual/dev-5.2/data-pipeline/processors/fluent-typed-scripting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
