examples/wasi_serde_json/README.md
This source source tree provides an example of WASM program with WASI mode.
Add wasm32-wasip1 target for Rust toolchain:
$ rustup target add wasm32-wasip1
Then, execute cargo build as follows:
$ cargo build --target wasm32-wasip1 --release
Finally, under target/wasm32-wasip1/release directory, *.wasm file will be created:
$ ls target/wasm32-wasip1/release/*.wasm
target/wasm32-wasip1/release/wasi_serde_json.wasm
Create parsers.conf as follows:
[PARSER]
Name wasi
Format json
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L %z
And Create fluent-bit configuration file as follows:
[SERVICE]
Flush 1
Daemon Off
Parsers_File parsers.conf
Log_Level info
HTTP_Server Off
HTTP_Listen 0.0.0.0
HTTP_Port 2020
[INPUT]
Name exec_wasi
Tag exec.wasi.local
WASI_Path /path/to/wasi_serde_json.wasm
Parser wasi
[OUTPUT]
Name stdout
Match *