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
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
+
accessible_paths: /path/to/fluent-bit
118
+
119
+
outputs:
120
+
- name: stdout
121
+
match: '*'
122
+
```
123
+
124
+
{% endtab %}
125
+
{% tab title="fluent-bit.conf" %}
102
126
103
127
```text
104
128
[INPUT]
@@ -110,13 +134,16 @@ Once built, a Wasm program will be available. Then you can execute that built pr
110
134
Match dummy.*
111
135
WASM_Path /path/to/built_filter.wasm
112
136
Function_Name super_awesome_filter
113
-
accessible_paths .,/path/to/fluent-bit
137
+
accessible_paths /path/to/fluent-bit
114
138
115
139
[OUTPUT]
116
140
Name stdout
117
141
Match *
118
142
```
119
143
144
+
{% endtab %}
145
+
{% endtabs %}
146
+
120
147
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
148
122
149
```text
@@ -125,8 +152,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.
155
+
128
156
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