fluent / fluent/fluent-bit

Support passing config options to WASM Filters

Open
#11,209 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
8.1k
Forks
2k
Avg merge
4d 16h
Merged PRs (30d)
58

Description

**Is your feature request related to a problem? Please describe.**

I would like to implement a re-usable wasm program to perform filter operations using jq-style statements. For this to be re-usable it would be best to have a way for the wasm filter to be able to pass additional parameters to the wasm function, such that I could pass the jq statement to the function, which was previously extracted from kubernetes pod annotations.

**Describe the solution you'd like**

Really any way to pass structured data from the filter configuration to the WASM program:

* A single string option[^1]
* A single option that takes multiple values to be passed as an array (json, msgpack) to the function[^1]
* A repeatable option[^1]

[^1]: should support record accessor syntax

**Describe alternatives you've considered**

1. using some record field convention, so a previous filter could put the jq statement into e.g. __jq_filter and the wasm filter would look for that field, extract it, apply it and remove the __jq_filter field.
2. writing the filter in C, see #11210

**Additional context**

A plugin like this would allow people to write generic reusable modules in wasm without resorting to potentially fragile record field conventions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.