@@ -38,6 +38,8 @@ $ fluent-bit -i dummy -F lua -p script=test.lua -p call=cb_print -m '*' -o null
38
38
39
39
In your main configuration file append the following _ Input_ , _ Filter_ & _ Output_ sections:
40
40
41
+ {% tabs %}
42
+ {% tab title="fluent-bit.conf" %}
41
43
``` python
42
44
[INPUT ]
43
45
Name dummy
@@ -52,6 +54,25 @@ In your main configuration file append the following _Input_, _Filter_ & _Output
52
54
Name null
53
55
Match *
54
56
```
57
+ {% endtab %}
58
+
59
+ {% tab title="fluent-bit.yaml" %}
60
+ ``` yaml
61
+ pipeline :
62
+ inputs :
63
+ - name : dummy
64
+ filters :
65
+ - name : lua
66
+ match : ' *'
67
+ script : test.lua
68
+ call : cb_print
69
+ outputs :
70
+ - name : null
71
+ match : ' *'
72
+ ` ` `
73
+ {% endtab %}
74
+ {% endtabs %}
75
+
55
76
56
77
## Lua Script Filter API <a id="lua_script"></a>
57
78
@@ -101,6 +122,32 @@ For functional examples of this interface, please refer to the code samples prov
101
122
102
123
The [Fluent Bit smoke tests](https://github.com/fluent/fluent-bit/tree/master/packaging/testing/smoke/container) include examples to verify during CI.
103
124
125
+ {% tabs %}
126
+ {% tab title="fluent-bit.conf" %}
127
+ ```
128
+ [ SERVICE]
129
+ flush 1
130
+ daemon off
131
+ log_level debug
132
+
133
+ [ INPUT]
134
+ Name random
135
+ Tag test
136
+ Samples 10
137
+
138
+ [ FILTER]
139
+ Name Lua
140
+ Match *
141
+ call append_tag
142
+ code function append_tag(tag, timestamp, record) new_record = record new_record[ "tag"] = tag return 1, timestamp, new_record end
143
+
144
+ [ OUTPUT]
145
+ Name stdout
146
+ Match *
147
+ ```
148
+ {% endtab %}
149
+
150
+ {% tab title="fluent-bit.yaml" %}
104
151
```yaml
105
152
service:
106
153
flush: 1
@@ -128,30 +175,8 @@ pipeline:
128
175
- name: stdout
129
176
match: "*"
130
177
```
131
-
132
- In classic mode:
133
-
134
- ` ` `
135
- [SERVICE]
136
- flush 1
137
- daemon off
138
- log_level debug
139
-
140
- [INPUT]
141
- Name random
142
- Tag test
143
- Samples 10
144
-
145
- [FILTER]
146
- Name Lua
147
- Match *
148
- call append_tag
149
- code function append_tag(tag, timestamp, record) new_record = record new_record["tag"] = tag return 1, timestamp, new_record end
150
-
151
- [OUTPUT]
152
- Name stdout
153
- Match *
154
- ```
178
+ {% endtab %}
179
+ {% endtabs %}
155
180
156
181
#### Environment variable processing
157
182
@@ -166,15 +191,33 @@ The environment variable is set like so:
166
191
167
192
We want to extract the ` sandboxbsh ` name and add it to our record as a special key.
168
193
194
+ {% tabs %}
195
+ {% tab title="fluent-bit.conf" %}
169
196
```
170
197
[FILTER]
171
198
Name lua
172
199
Alias filter-iots-lua
173
200
Match iots_thread.*
174
201
Script filters.lua
175
202
Call set_landscape_deployment
203
+ ```
204
+ {% endtab %}
205
+
206
+ {% tab title="fluent-bit.yaml" %}
207
+ ``` yaml
208
+ filters :
209
+ - name : lua
210
+ alias : filter-iots-lua
211
+ match : iots_thread.*
212
+ script : filters.lua
213
+ call : set_landscape_deployment
214
+ ` ` `
215
+ {% endtab %}
216
+ {% endtabs %}
176
217
177
- filters.lua: |
218
+
219
+ filters.lua:
220
+ ` ` ` lua
178
221
-- Use a Lua function to create some additional entries based
179
222
-- on substrings from the kubernetes properties.
180
223
function set_landscape_deployment(tag, timestamp, record)
227
270
228
271
#### Configuration
229
272
273
+ {% tabs %}
274
+ {% tab title="fluent-bit.conf" %}
230
275
``` python
231
276
[Input]
232
277
Name stdin
241
286
Name stdout
242
287
Match *
243
288
```
289
+ {% endtab %}
290
+
291
+ {% tab title="fluent-bit.yaml" %}
292
+ ``` yaml
293
+ pipeline :
294
+ inputs :
295
+ - name : stdin
296
+ filters :
297
+ - name : lua
298
+ match : ' *'
299
+ script : test.lua
300
+ call : cb_split
301
+ outputs :
302
+ - name : stdout
303
+ match : ' *'
304
+ ` ` `
305
+ {% endtab %}
306
+ {% endtabs %}
244
307
245
308
#### Input
246
309
290
353
291
354
Configuration to get istio logs and apply response code filter to them.
292
355
356
+ {% tabs %}
357
+ {% tab title="fluent-bit.conf" %}
293
358
``` ini
294
359
[INPUT]
295
360
Name tail
@@ -309,6 +374,29 @@ Configuration to get istio logs and apply response code filter to them.
309
374
Name stdout
310
375
Match *
311
376
```
377
+ {% endtab %}
378
+
379
+ {% tab title="fluent-bit.yaml" %}
380
+ ``` yaml
381
+ pipeline :
382
+ inputs :
383
+ - name : tail
384
+ path : /var/log/containers/*_istio-proxy-*.log
385
+ multiline.parser : ' docker, cri'
386
+ tag : istio.*
387
+ mem_buf_limit : 64MB
388
+ skip_long_lines : off
389
+ filters :
390
+ - name : lua
391
+ match : istio.*
392
+ script : response_code_filter.lua
393
+ call : cb_response_code_filter
394
+ outputs :
395
+ - name : stdout
396
+ match : ' *'
397
+ ` ` `
398
+ {% endtab %}
399
+ {% endtabs %}
312
400
313
401
#### Input
314
402
0 commit comments