Lua
Due to the necessity to have a flexible filtering mechanism, now is possible to extend Fluent Bit capabilities writing simple filters using Lua programming language. A Lua based filter takes two steps:
- Configure the Filter in the main configuration
Content:
The plugin supports the following configuration parameters:
From the command line you can use the following options:
In your main configuration file append the following Input, Filter & Output sections:
The life cycle of a filter have the following steps:
- Upon Tag matching by filter_lua, it may process or bypass the record.
- If filter_lua accepts the record, it will invoke the function defined in the call property which basically is the name of a function defined in the Lua script.
- Upon return, validate return value and take some action (described above)
Function Arguments
Return Values
Each callback must return three values:
For functional examples of this interface, please refer to the code samples provided in the source code of the project located here: