diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:20:02 +0000 |
commit | 58daab21cd043e1dc37024a7f99b396788372918 (patch) | |
tree | 96771e43bb69f7c1c2b0b4f7374cb74d7866d0cb /fluent-bit/examples/filter_rust/README.md | |
parent | Releasing debian version 1.43.2-1. (diff) | |
download | netdata-58daab21cd043e1dc37024a7f99b396788372918.tar.xz netdata-58daab21cd043e1dc37024a7f99b396788372918.zip |
Merging upstream version 1.44.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fluent-bit/examples/filter_rust/README.md')
-rw-r--r-- | fluent-bit/examples/filter_rust/README.md | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/fluent-bit/examples/filter_rust/README.md b/fluent-bit/examples/filter_rust/README.md new file mode 100644 index 000000000..f1f3841a6 --- /dev/null +++ b/fluent-bit/examples/filter_rust/README.md @@ -0,0 +1,59 @@ +# Fluent Bit / filter_rust + +This source source tree provides an example of WASM program with WASI mode mainly written in Rust. + +## Prerequisites + +* Rust + * rustc 1.61.0 (fe5b13d68 2022-05-18) +* [rustup](https://rustup.rs/) (For preparing rust compiler and toolchains) + +## How to build + +Add `wasm32-unknown-unknown` target for Rust toolchain: + +```console +$ rustup target add wasm32-unknown-unknown +``` + +Then, execute _cargo build_ as follows: + +```console +$ cargo build --target wasm32-unknown-unknown --release +``` + +Finally, `*.wasm` file will be created: + +```console +$ ls target/wasm32-unknown-unknown/release/*.wasm +target/wasm32-unknown-unknown/release/filter_rust.wasm +``` + +## How to confirm WASM filter integration + +Create fluent-bit configuration file as follows: + +```ini +[SERVICE] + Flush 1 + Daemon Off + Log_Level info + HTTP_Server Off + HTTP_Listen 0.0.0.0 + HTTP_Port 2020 + +[INPUT] + Name dummy + Tag dummy.local + +[FILTER] + Name wasm + match dummy.* + WASM_Path /path/to/filter_rust.wasm + Function_Name rust_filter + accessible_paths .,/path/to/fluent-bit + +[OUTPUT] + Name stdout + Match * +``` |