You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[WebAssembly](https://webassembly.org/) is binary instruction format for stackbased virtual machine.
3
+
[WebAssembly](https://webassembly.org/)(Wasm) is a binary instruction format for stack-based virtual machines.
4
4
5
-
Fluent Bit currently supports integration of wasm plugins built as wasm/wasi objects for input and filter plugins only.
6
-
The interface for the WASM filter plugins is currently under development but is functional.
5
+
Fluent Bit supports integration of Wasm plugins built as Wasm/WASI objects for inputs and filter plugins only. The interface for Wasm filter plugins is currently under development but is functional.
7
6
8
7
## Prerequisites
9
8
10
-
### Building Fluent Bit
9
+
### Build Fluent Bit
11
10
12
-
There are no additional requirements to execute WASM plugins.
11
+
There are no additional requirements to execute Wasm plugins.
13
12
14
-
### For Build WASM programs
13
+
### For Wasm programs
15
14
16
-
Currently, fluent-bit supports the following WASM toolchains:
15
+
Fluent Bit supports the following Wasm toolchains:
17
16
18
-
* Rust on `wasm32-unknown-unknown`.
17
+
* Rust on `wasm32-unknown-unknown`
19
18
* rustc 1.62.1 (e092d0b6b 2022-07-16) or later
20
-
*[TinyGo](https://github.com/tinygo-org/tinygo) on wasm32-wasi
19
+
*[TinyGo](https://github.com/tinygo-org/tinygo) on `wasm32-wasi`
21
20
* v0.24.0 or later
22
-
*[WASI SDK](https://github.com/WebAssembly/wasi-sdk) 13 or later.
21
+
*[WASI SDK](https://github.com/WebAssembly/wasi-sdk) 13 or later
23
22
24
-
## Getting Started
23
+
## Get started
25
24
26
-
Compile Fluent Bit with WASM support, e.g:
25
+
Compile Fluent Bit with Wasm support. For example:
27
26
28
27
```text
29
28
$ cd build/
30
29
$ cmake ..
31
30
$ make
32
31
```
33
32
34
-
Once compiled, we can see new plugins in which handles _wasm_, e.g:
33
+
Once compiled, you can see new plugins that handle `wasm`. For example:
35
34
36
35
```text
37
36
$ bin/fluent-bit -h
@@ -45,28 +44,25 @@ Filters
45
44
wasm WASM program filter
46
45
```
47
46
48
-
## Build a WASM Input for Input Plugin
47
+
## Build a Wasm input for input plugin
49
48
50
-
Currently, Fluent Bit's WASM input assumes WASI ABI that is also known as `wasm32-wasi` on Rust target and `wasm32-wasi` on TinyGo target.
49
+
Wasm input in Fluent Bitassumes WASI ABI, also known as `wasm32-wasi` on Rust target and `wasm32-wasi` on TinyGo target.
51
50
52
-
### To Install Additional Components
51
+
### Install additional components
53
52
54
-
TinyGo and WASI SDK support wasm target by default.
55
-
When using Rust's `wasm32-wasi` target, users must install `wasm32-wasi` via [rustup](https://rustup.rs/). Then, installing that target components as:
53
+
TinyGo and WASI SDK support Wasm target by default. When using Rust's `wasm32-wasi` target, you must install `wasm32-wasi` by using [rustup](https://rustup.rs/). Then, install the target components as:
56
54
57
55
```text
58
56
$ rustup target add wasm32-wasi
59
57
```
60
58
61
-
### Requirements of WASM/WASI programs
59
+
### Requirements of Wasm/WASI programs
62
60
63
-
WASM input plugins execute the function that has wasi main function entrypoint.
64
-
And Fluent Bit's WASM input plugin communicates via stdout on WASM programs.
61
+
Wasm input plugins execute the function that has a WASI main function entrypoint, and Wasm input plugins in Fluent Bit communicate through stdout on Wasm programs.
65
62
66
-
WASM programs should handle stdout for ingesting logs into Fluent Bit.
63
+
Wasm programs should handle stdout for ingesting logs into Fluent Bit.
67
64
68
-
69
-
Once built, a WASM/WASI program will be available. Then, that built program can be executed with the following Fluent Bit configuration:
65
+
Once built, a Wasm/WASI program will be available. Then you can execute that built program with the following Fluent Bit configuration:
70
66
71
67
```text
72
68
[INPUT]
@@ -82,4 +78,4 @@ Once built, a WASM/WASI program will be available. Then, that built program can
82
78
Match *
83
79
```
84
80
85
-
For further example that handles structured logs, fluent-bit has a Rust serde-json example: https://github.com/fluent/fluent-bit/tree/master/examples/wasi_serde_json
81
+
For an example that handles structured logs, see the [Rust `serde-json` example](https://github.com/fluent/fluent-bit/tree/master/examples/wasi_serde_json).
0 commit comments