Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/filter/lua_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ type Lua struct {
// If enabled, Lua script will be executed in protected mode.
// It prevents to crash when invalid Lua script is executed. Default is true.
ProtectedMode *bool `json:"protectedMode,omitempty"`
// If enabled, null will be converted to flb_null in Lua.
// This helps prevent removing key/value since nil is a special value to remove key/value from map in Lua. Default value: false.
EnableFlbNull *bool `json:"enable_flb_null,omitempty"`
// By default when the Lua script is invoked, the record timestamp is passed as a
// Floating number which might lead to loss precision when the data is converted back.
// If you desire timestamp precision enabling this option will pass the timestamp as
Expand Down Expand Up @@ -90,6 +93,10 @@ func (l *Lua) Params(_ plugins.SecretLoader) (*params.KVs, error) {
kvs.Insert("protected_mode", strconv.FormatBool(*l.ProtectedMode))
}

if l.EnableFlbNull != nil {
kvs.Insert("enable_flb_null", strconv.FormatBool(*l.EnableFlbNull))
}

if l.TimeAsTable {
kvs.Insert("time_as_table", "true")
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion charts/fluent-bit-crds/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: fluent-bit-crds
description: A helm chart for Fluent-Bit custom resource definitions (CRDs) used by fluent-operator.
type: application
version: 0.2.0
version: 0.2.1
appVersion: v3.5.0
keywords:
- logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@ spec:
description: Inline LUA code instead of loading from a path
via script.
type: string
enable_flb_null:
description: |-
If enabled, null will be converted to flb_null in Lua.
This helps prevent removing key/value since nil is a special value to remove key/value from map in Lua. Default value: false.
type: boolean
protectedMode:
description: |-
If enabled, Lua script will be executed in protected mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@ spec:
description: Inline LUA code instead of loading from a path
via script.
type: string
enable_flb_null:
description: |-
If enabled, null will be converted to flb_null in Lua.
This helps prevent removing key/value since nil is a special value to remove key/value from map in Lua. Default value: false.
type: boolean
protectedMode:
description: |-
If enabled, Lua script will be executed in protected mode.
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusterfilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ spec:
description: Inline LUA code instead of loading from a path
via script.
type: string
enable_flb_null:
description: |-
If enabled, null will be converted to flb_null in Lua.
This helps prevent removing key/value since nil is a special value to remove key/value from map in Lua. Default value: false.
type: boolean
protectedMode:
description: |-
If enabled, Lua script will be executed in protected mode.
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_filters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ spec:
description: Inline LUA code instead of loading from a path
via script.
type: string
enable_flb_null:
description: |-
If enabled, null will be converted to flb_null in Lua.
This helps prevent removing key/value since nil is a special value to remove key/value from map in Lua. Default value: false.
type: boolean
protectedMode:
description: |-
If enabled, Lua script will be executed in protected mode.
Expand Down
10 changes: 10 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ spec:
description: Inline LUA code instead of loading from a path
via script.
type: string
enable_flb_null:
description: |-
If enabled, null will be converted to flb_null in Lua.
This helps prevent removing key/value since nil is a special value to remove key/value from map in Lua. Default value: false.
type: boolean
protectedMode:
description: |-
If enabled, Lua script will be executed in protected mode.
Expand Down Expand Up @@ -15389,6 +15394,11 @@ spec:
description: Inline LUA code instead of loading from a path
via script.
type: string
enable_flb_null:
description: |-
If enabled, null will be converted to flb_null in Lua.
This helps prevent removing key/value since nil is a special value to remove key/value from map in Lua. Default value: false.
type: boolean
protectedMode:
description: |-
If enabled, Lua script will be executed in protected mode.
Expand Down
10 changes: 10 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ spec:
description: Inline LUA code instead of loading from a path
via script.
type: string
enable_flb_null:
description: |-
If enabled, null will be converted to flb_null in Lua.
This helps prevent removing key/value since nil is a special value to remove key/value from map in Lua. Default value: false.
type: boolean
protectedMode:
description: |-
If enabled, Lua script will be executed in protected mode.
Expand Down Expand Up @@ -15389,6 +15394,11 @@ spec:
description: Inline LUA code instead of loading from a path
via script.
type: string
enable_flb_null:
description: |-
If enabled, null will be converted to flb_null in Lua.
This helps prevent removing key/value since nil is a special value to remove key/value from map in Lua. Default value: false.
type: boolean
protectedMode:
description: |-
If enabled, Lua script will be executed in protected mode.
Expand Down
Loading