From 225c35d00e7970cc87e47abc6a605fd55960f6f9 Mon Sep 17 00:00:00 2001 From: Lynette Miles Date: Thu, 29 May 2025 14:47:08 -0700 Subject: [PATCH 1/2] Pipeline: filter: wasm: style Signed-off-by: Lynette Miles --- pipeline/filters/wasm.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pipeline/filters/wasm.md b/pipeline/filters/wasm.md index 0140bc28d..3583ae64b 100644 --- a/pipeline/filters/wasm.md +++ b/pipeline/filters/wasm.md @@ -1,31 +1,31 @@ --- -description: Use Wasm programs as a filter +description: Use Wasm programs as a filter. --- -# Wasm Filter +# Wasm -Wasm Filter allows you to modify the incoming records using [Wasm](https://webassembly.org/) technology. +The _Wasm_ Filter lets you 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: +You can extend Fluent Bit capabilities by writing custom filters using built Wasm programs and its runtime. A Wasm-based filter takes the following steps: -0. (Optional) Compiled as AOT (Ahead Of Time) objects to optimize Wasm execution pipeline -1. Configure the Filter in the main configuration -2. Prepare a Wasm program that will be used by the Filter +1. (Optional) Compile Ahead Of Time (AOT) objects to optimize the Wasm execution pipeline. +1. Configure the filter in the main configuration. +1. Prepare a Wasm program that will be used by the filter. -## Configuration Parameters +## Configuration parameters 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. | -| Event\_Format | Define event format to interact with Wasm programs: msgpack or json. Default: json | -| 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 whitelist of paths to be able to access paths from WASM programs. | -| Wasm\_Heap\_Size | Size of the heap size of Wasm execution. Review [unit sizes](../../administration/configuring-fluent-bit/unit-sizes.md) for allowed values. | -| Wasm\_Stack\_Size | Size of the stack size of Wasm execution. Review [unit sizes](../../administration/configuring-fluent-bit/unit-sizes.md) for allowed values. | - -## Configuration Examples +| `Wasm_Path` | Path to the built Wasm program that will be used. This can be a path relative to the main configuration file. | +| `Event_Format` | Define event format to interact with Wasm programs: `msgpack` or `json`. Default: `json`. | +| `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 previously. | +| `Accessible_Paths` | Specify the allowlist of paths to be able to access paths from Wasm programs. | +| `Wasm_Heap_Size` | Size of the heap size of Wasm execution. Review [unit sizes](../../administration/configuring-fluent-bit/unit-sizes.md) for allowed values. | +| `Wasm_Stack_Size` | Size of the stack size of Wasm execution. Review [unit sizes](../../administration/configuring-fluent-bit/unit-sizes.md) for allowed values. | + +## Configuration example Here is a configuration example. From d9ef56a99f0262f8a672d51288bc391b3bdabb68 Mon Sep 17 00:00:00 2001 From: Lynette Miles <6818907+esmerel@users.noreply.github.com> Date: Fri, 30 May 2025 08:53:39 -0700 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Alexa Kreizinger Signed-off-by: Lynette Miles <6818907+esmerel@users.noreply.github.com> --- pipeline/filters/wasm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline/filters/wasm.md b/pipeline/filters/wasm.md index 3583ae64b..13d83ff2c 100644 --- a/pipeline/filters/wasm.md +++ b/pipeline/filters/wasm.md @@ -4,7 +4,7 @@ description: Use Wasm programs as a filter. # Wasm -The _Wasm_ Filter lets you modify the incoming records using [Wasm](https://webassembly.org/) technology. +The _Wasm_ filter lets you modify the incoming records using [Wasm](https://webassembly.org/) technology. You can extend Fluent Bit capabilities by writing custom filters using built Wasm programs and its runtime. A Wasm-based filter takes the following steps: