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
Copy file name to clipboardExpand all lines: pipeline/filters/lua.md
+180
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ The plugin supports the following configuration parameters:
21
21
| time\_as\_table | By default when the Lua script is invoked, the record timestamp is passed as a *floating number* which might lead to precision loss when it is converted back. If you desire timestamp precision, enabling this option will pass the timestamp as a Lua table with keys `sec` for seconds since epoch and `nsec` for nanoseconds. |
22
22
| code | Inline LUA code instead of loading from a path via `script`. |
23
23
| enable_flb_null| If enabled, null will be converted to flb_null in Lua. It is useful to prevent removing key/value since nil is a special value to remove key value from map in Lua. Default is false. |
24
+
| chunk_mode | If enabled, a whole chunk will be sent to Lua script as a table of timestamps and records. It may be used for e.g. parallel execution inside Lua. Default is false. |
24
25
25
26
## Getting Started <aid="getting_started"></a>
26
27
@@ -348,3 +349,182 @@ Configuration to get istio logs and apply response code filter to them.
348
349
#### Output
349
350
350
351
In the output only the messages with response code 0 or greater than 399 are shown.
352
+
353
+
### Chunk mode
354
+
355
+
There is a `chunk_mode` for the Lua filter in Fluent Bit. This mode can be useful for cases like parallelization, particularly when utilizing Lua lanes.
356
+
357
+
#### Function Signature
358
+
359
+
The Lua functions associated with this mode accept only two arguments:
360
+
361
+
```
362
+
function process_records(tag, records)
363
+
```
364
+
365
+
#### Configuration
366
+
367
+
The configuration for the Lua filter using chunk mode looks like this:
368
+
369
+
```
370
+
[FILTER]
371
+
Name lua
372
+
Match my_logs
373
+
script lanes_example.lua
374
+
call process_records
375
+
chunk_mode On
376
+
time_as_table On
377
+
```
378
+
#### Note
379
+
380
+
- This mode currently only supports `time_as_table` by default.
381
+
- Records are always emitted; there is no return code to be set.
382
+
383
+
#### Return Table Format
384
+
385
+
The return table must maintain this format, i.e., a table of timestamp and record pairs.
0 commit comments