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
Copy file name to clipboardExpand all lines: development/wasm-input-plugins.md
+30-4Lines changed: 30 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,20 +62,46 @@ Wasm input plugins execute the function that has a WASI main function entrypoint
62
62
63
63
Wasm programs should handle stdout for ingesting logs into Fluent Bit.
64
64
65
-
Once built, a Wasm/WASI program will be available. Then you can execute that built program with the following Fluent Bit configuration:
65
+
Once built, a Wasm/WASI program will be available. Then you can execute that program with one of the following Fluent Bit configurations:
66
+
67
+
{% tabs %}
68
+
{% tab title="fluent-bit.yaml" %}
69
+
70
+
```yaml
71
+
pipeline:
72
+
inputs:
73
+
- name: exec_wasi
74
+
tag: exec.wasi.local
75
+
wasi_path: /path/to/wasi_built_json.wasm
76
+
# For security reasons, WASM/WASI program cannot access its outer world
77
+
# without accessible permissions. Uncomment below 'accessible_paths' and
78
+
# run Fluent Bit from the 'wasi_path' location:
79
+
# accessible_paths /path/to/fluent-bit
80
+
81
+
outputs:
82
+
- name: stdout
83
+
match: '*'
84
+
```
85
+
86
+
{% endtab %}
87
+
{% tab title="fluent-bit.conf" %}
66
88
67
89
```text
68
90
[INPUT]
69
91
Name exec_wasi
70
92
Tag exec.wasi.local
71
93
WASI_Path /path/to/wasi_built_json.wasm
72
94
# For security reasons, WASM/WASI program cannot access its outer world
73
-
# without accessible permissions.
74
-
# accessible_paths .,/path/to/fluent-bit
95
+
# without accessible permissions. Uncomment below 'accessible_paths' and
96
+
# run Fluent Bit from the 'wasi_path' location:
97
+
# accessible_paths /path/to/fluent-bit
75
98
76
99
[OUTPUT]
77
100
Name stdout
78
101
Match *
79
102
```
80
103
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).
104
+
{% endtab %}
105
+
{% endtabs %}
106
+
107
+
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