Skip to content

Commit f46eae6

Browse files
authored
Adding YAML example for wasm input plugins doc. Fixes #1775. (#1776)
Signed-off-by: Eric D. Schabell <[email protected]>
1 parent 38bd1ce commit f46eae6

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

development/wasm-input-plugins.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,46 @@ Wasm input plugins execute the function that has a WASI main function entrypoint
6262

6363
Wasm programs should handle stdout for ingesting logs into Fluent Bit.
6464

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" %}
6688
6789
```text
6890
[INPUT]
6991
Name exec_wasi
7092
Tag exec.wasi.local
7193
WASI_Path /path/to/wasi_built_json.wasm
7294
# 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
7598

7699
[OUTPUT]
77100
Name stdout
78101
Match *
79102
```
80103

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

Comments
 (0)