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
* Adding YAML examples to developers wasm filter plugin docs. Fixes ##1768.
Signed-off-by: Eric D. Schabell <[email protected]>
* Added comment for accessable_path and running Fluent Bit from the wasam app location.
Signed-off-by: Eric D. Schabell <[email protected]>
---------
Signed-off-by: Eric D. Schabell <[email protected]>
The `//export XXX` attribute on TinyGo and `#[no_mangle]` attribute on Rust are required. This is because TinyGo and Rust will mangle their function names if they aren't specified.
100
100
101
-
Once built, a Wasm program will be available. Then you can execute that built program with the following Fluent Bit configuration:
101
+
Once built, a Wasm program will be available. Then you can execute that built program with one of the following Fluent Bit configurations:
102
+
103
+
{% tabs %}
104
+
{% tab title="fluent-bit.yaml" %}
105
+
106
+
```yaml
107
+
pipeline:
108
+
inputs:
109
+
- name: dummy
110
+
tag: dummy.local
111
+
112
+
filters:
113
+
- name: wasm
114
+
match: 'dummy.*'
115
+
wasm_path: /path/to/built_filter.wasm
116
+
function_name: super_awesome_filter
117
+
# Note: run Fluent Bit from the 'wasm_path' location.
118
+
accessible_paths: /path/to/fluent-bit
119
+
120
+
outputs:
121
+
- name: stdout
122
+
match: '*'
123
+
```
124
+
125
+
{% endtab %}
126
+
{% tab title="fluent-bit.conf" %}
102
127
103
128
```text
104
129
[INPUT]
@@ -110,13 +135,16 @@ Once built, a Wasm program will be available. Then you can execute that built pr
110
135
Match dummy.*
111
136
WASM_Path /path/to/built_filter.wasm
112
137
Function_Name super_awesome_filter
113
-
accessible_paths .,/path/to/fluent-bit
138
+
accessible_paths /path/to/fluent-bit
114
139
115
140
[OUTPUT]
116
141
Name stdout
117
142
Match *
118
143
```
119
144
145
+
{% endtab %}
146
+
{% endtabs %}
147
+
120
148
For example, one of the sample [Rust Wasm filters](https://github.com/fluent/fluent-bit/tree/master/examples/filter_rust) should generate its filtered logs as follows:
121
149
122
150
```text
@@ -125,8 +153,34 @@ For example, one of the sample [Rust Wasm filters](https://github.com/fluent/flu
Another example of a Rust Wasm filter is the [flb_filter_iis](https://github.com/kenriortega/flb_filter_iis) filter.
156
+
128
157
This filter takes the [Internet Information Services (IIS)](https://learn.microsoft.com/en-us/iis/manage/provisioning-and-managing-iis/configure-logging-in-iis)[w3c logs](https://learn.microsoft.com/en-us/iis/manage/provisioning-and-managing-iis/configure-logging-in-iis#select-w3c-fields-to-log) (with some custom modifications) and transforms the raw string into a standard Fluent Bit JSON structured record.
0 commit comments