# Wasm

Wasm Filter allows you to modify the incoming records using [Wasm](https://webassembly.org/) technology.

Due to the necessity to have a flexible filtering mechanism, it is now possible to extend Fluent Bit capabilities by writing custom filters using built Wasm programs and its runtime. A Wasm-based filter takes two steps:

1. (Optional) Compiled as AOT (Ahead Of Time) objects to optimize Wasm execution pipeline
2. Configure the Filter in the main configuration
3. Prepare a Wasm program that will be used by the Filter

## Configuration Parameters <a href="#config" id="config"></a>

The plugin supports the following configuration parameters:

| Key               | Description                                                                                                                                 |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Wasm\_Path        | Path to the built Wasm program that will be used. This can be a relative path against the main configuration file.                          |
| Function\_Name    | Wasm function name that will be triggered to do filtering. It's assumed that the function is built inside the Wasm program specified above. |
| Accessible\_Paths | Specify the whilelist of paths to be able to access paths from WASM programs.                                                               |

## Configuration Examples <a href="#config_example" id="config_example"></a>

Here is a configuration example.

```python
[INPUT]
    Name   dummy
    Tag    dummy.local

[FILTER]
    Name wasm
    Match dummy.*
    WASM_Path /path/to/wasm_program.wasm
    Function_Name filter_function_name
    Accessible_Paths .,/path/to/accessible

[OUTPUT]
    Name   stdout
    Match  *
```


---

# 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/2.2/pipeline/filters/wasm.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.
