From a4537eff44156b85093062941be2f76a85dd5a3f Mon Sep 17 00:00:00 2001 From: Nick Galtry Date: Tue, 17 Feb 2026 09:46:45 +0000 Subject: [PATCH 1/3] adds support for workers to syslog output Signed-off-by: Nick Galtry --- .../v1alpha2/plugins/output/syslog_types.go | 3 +++ .../fluentbit.fluent.io_clusteroutputs.yaml | 6 ++++++ .../templates/fluentbit.fluent.io_outputs.yaml | 6 ++++++ .../bases/fluentbit.fluent.io_clusteroutputs.yaml | 6 ++++++ config/crd/bases/fluentbit.fluent.io_outputs.yaml | 6 ++++++ docs/plugins/fluentbit/output/syslog.md | 1 + manifests/setup/fluent-operator-crd.yaml | 12 ++++++++++++ manifests/setup/setup.yaml | 12 ++++++++++++ 8 files changed, 52 insertions(+) diff --git a/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go b/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go index ec3bb1e69..416007ac0 100644 --- a/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go +++ b/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go @@ -45,6 +45,8 @@ type Syslog struct { *plugins.Networking `json:"networking,omitempty"` // Limit the maximum number of Chunks in the filesystem for the current output logical destination. TotalLimitSize string `json:"totalLimitSize,omitempty"` + // Enables dedicated thread(s) for this output. Default value is set since version 1.8.13. For previous versions is 0. + Workers *int32 `json:"workers,omitempty"` } func (*Syslog) Name() string { @@ -69,6 +71,7 @@ func (s *Syslog) Params(sl plugins.SecretLoader) (*params.KVs, error) { plugins.InsertKVString(kvs, "syslog_sd_key", s.SyslogSDKey) plugins.InsertKVString(kvs, "storage.total_limit_size", s.TotalLimitSize) plugins.InsertKVField(kvs, "syslog_maxsize", s.SyslogMaxSize) + plugins.InsertKVField(kvs, "Workers", s.Workers) if s.TLS != nil { tls, err := s.TLS.Params(sl) diff --git a/charts/fluent-bit-crds/templates/fluentbit.fluent.io_clusteroutputs.yaml b/charts/fluent-bit-crds/templates/fluentbit.fluent.io_clusteroutputs.yaml index 2a1cf80b9..6040c61b0 100644 --- a/charts/fluent-bit-crds/templates/fluentbit.fluent.io_clusteroutputs.yaml +++ b/charts/fluent-bit-crds/templates/fluentbit.fluent.io_clusteroutputs.yaml @@ -4239,6 +4239,12 @@ spec: description: Limit the maximum number of Chunks in the filesystem for the current output logical destination. type: string + workers: + description: Enables dedicated thread(s) for this output. Default + value is set since version 1.8.13. For previous versions is + 0. + format: int32 + type: integer type: object tcp: description: TCP defines TCP Output configuration. diff --git a/charts/fluent-bit-crds/templates/fluentbit.fluent.io_outputs.yaml b/charts/fluent-bit-crds/templates/fluentbit.fluent.io_outputs.yaml index beb07f0ca..0a0290cf6 100644 --- a/charts/fluent-bit-crds/templates/fluentbit.fluent.io_outputs.yaml +++ b/charts/fluent-bit-crds/templates/fluentbit.fluent.io_outputs.yaml @@ -4239,6 +4239,12 @@ spec: description: Limit the maximum number of Chunks in the filesystem for the current output logical destination. type: string + workers: + description: Enables dedicated thread(s) for this output. Default + value is set since version 1.8.13. For previous versions is + 0. + format: int32 + type: integer type: object tcp: description: TCP defines TCP Output configuration. diff --git a/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml b/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml index 45587292c..1e0b0d206 100644 --- a/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml +++ b/config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml @@ -4236,6 +4236,12 @@ spec: description: Limit the maximum number of Chunks in the filesystem for the current output logical destination. type: string + workers: + description: Enables dedicated thread(s) for this output. Default + value is set since version 1.8.13. For previous versions is + 0. + format: int32 + type: integer type: object tcp: description: TCP defines TCP Output configuration. diff --git a/config/crd/bases/fluentbit.fluent.io_outputs.yaml b/config/crd/bases/fluentbit.fluent.io_outputs.yaml index f7c92a23a..8a6704564 100644 --- a/config/crd/bases/fluentbit.fluent.io_outputs.yaml +++ b/config/crd/bases/fluentbit.fluent.io_outputs.yaml @@ -4236,6 +4236,12 @@ spec: description: Limit the maximum number of Chunks in the filesystem for the current output logical destination. type: string + workers: + description: Enables dedicated thread(s) for this output. Default + value is set since version 1.8.13. For previous versions is + 0. + format: int32 + type: integer type: object tcp: description: TCP defines TCP Output configuration. diff --git a/docs/plugins/fluentbit/output/syslog.md b/docs/plugins/fluentbit/output/syslog.md index ee3829e79..96d18138b 100644 --- a/docs/plugins/fluentbit/output/syslog.md +++ b/docs/plugins/fluentbit/output/syslog.md @@ -21,3 +21,4 @@ Syslog output plugin allows you to deliver messages to Syslog servers.
** | tls | Syslog output plugin supports TTL/SSL, for more details about the properties available and general configuration, please refer to the TLS/SSL section. | *[plugins.TLS](../tls.md) | | networking | Include fluentbit networking options for this output-plugin | *plugins.Networking | | totalLimitSize | Limit the maximum number of Chunks in the filesystem for the current output logical destination. | string | +| workers | Enables dedicated thread(s) for this output. Default value is set since version 1.8.13. For previous versions is 0. | *int32 | diff --git a/manifests/setup/fluent-operator-crd.yaml b/manifests/setup/fluent-operator-crd.yaml index bf984fb8c..42ec63ae0 100644 --- a/manifests/setup/fluent-operator-crd.yaml +++ b/manifests/setup/fluent-operator-crd.yaml @@ -8389,6 +8389,12 @@ spec: description: Limit the maximum number of Chunks in the filesystem for the current output logical destination. type: string + workers: + description: Enables dedicated thread(s) for this output. Default + value is set since version 1.8.13. For previous versions is + 0. + format: int32 + type: integer type: object tcp: description: TCP defines TCP Output configuration. @@ -38442,6 +38448,12 @@ spec: description: Limit the maximum number of Chunks in the filesystem for the current output logical destination. type: string + workers: + description: Enables dedicated thread(s) for this output. Default + value is set since version 1.8.13. For previous versions is + 0. + format: int32 + type: integer type: object tcp: description: TCP defines TCP Output configuration. diff --git a/manifests/setup/setup.yaml b/manifests/setup/setup.yaml index 0adcdca85..031684a47 100644 --- a/manifests/setup/setup.yaml +++ b/manifests/setup/setup.yaml @@ -8389,6 +8389,12 @@ spec: description: Limit the maximum number of Chunks in the filesystem for the current output logical destination. type: string + workers: + description: Enables dedicated thread(s) for this output. Default + value is set since version 1.8.13. For previous versions is + 0. + format: int32 + type: integer type: object tcp: description: TCP defines TCP Output configuration. @@ -38442,6 +38448,12 @@ spec: description: Limit the maximum number of Chunks in the filesystem for the current output logical destination. type: string + workers: + description: Enables dedicated thread(s) for this output. Default + value is set since version 1.8.13. For previous versions is + 0. + format: int32 + type: integer type: object tcp: description: TCP defines TCP Output configuration. From be41f22d1a9ed0bf2d7c7bf52dca182c0d83a1fa Mon Sep 17 00:00:00 2001 From: Nick Galtry Date: Mon, 2 Mar 2026 14:43:38 +0000 Subject: [PATCH 2/3] Adds syslog_types_test.go and addresses lowercase for workers Signed-off-by: Nick Galtry --- .../v1alpha2/plugins/output/syslog_types.go | 4 +- .../plugins/output/syslog_types_test.go | 60 +++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 apis/fluentbit/v1alpha2/plugins/output/syslog_types_test.go diff --git a/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go b/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go index 416007ac0..61cb55ebf 100644 --- a/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go +++ b/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go @@ -46,7 +46,7 @@ type Syslog struct { // Limit the maximum number of Chunks in the filesystem for the current output logical destination. TotalLimitSize string `json:"totalLimitSize,omitempty"` // Enables dedicated thread(s) for this output. Default value is set since version 1.8.13. For previous versions is 0. - Workers *int32 `json:"workers,omitempty"` + workers *int32 `json:"workers,omitempty"` } func (*Syslog) Name() string { @@ -71,7 +71,7 @@ func (s *Syslog) Params(sl plugins.SecretLoader) (*params.KVs, error) { plugins.InsertKVString(kvs, "syslog_sd_key", s.SyslogSDKey) plugins.InsertKVString(kvs, "storage.total_limit_size", s.TotalLimitSize) plugins.InsertKVField(kvs, "syslog_maxsize", s.SyslogMaxSize) - plugins.InsertKVField(kvs, "Workers", s.Workers) + plugins.InsertKVField(kvs, "workers", s.workers) if s.TLS != nil { tls, err := s.TLS.Params(sl) diff --git a/apis/fluentbit/v1alpha2/plugins/output/syslog_types_test.go b/apis/fluentbit/v1alpha2/plugins/output/syslog_types_test.go new file mode 100644 index 000000000..b7b8d6ab1 --- /dev/null +++ b/apis/fluentbit/v1alpha2/plugins/output/syslog_types_test.go @@ -0,0 +1,60 @@ +package output + +import ( + "testing" + + "github.com/fluent/fluent-operator/v3/apis/fluentbit/v1alpha2/plugins" + "github.com/fluent/fluent-operator/v3/apis/fluentbit/v1alpha2/plugins/params" + "github.com/fluent/fluent-operator/v3/pkg/utils" + . "github.com/onsi/gomega" +) + +func TestOutput_Syslog_Params(t *testing.T) { + g := NewGomegaWithT(t) + + sl := plugins.NewSecretLoader(nil, "test-namespace") + + // Initialize Syslog struct based on your provided types + syslog := Syslog{ + Host: "127.0.0.1", + Port: utils.ToPtr[int32](514), + Mode: "tcp", + SyslogFormat: "rfc5424", + SyslogMaxSize: utils.ToPtr[int32](2048), + SyslogSeverityKey: "severity", + SyslogFacilityKey: "facility", + SyslogHostnameKey: "hostname", + SyslogAppnameKey: "appname", + SyslogProcessIDKey: "pid", + SyslogMessageIDKey: "msgid", + SyslogSDKey: "structured_data", + SyslogMessageKey: "message", + TotalLimitSize: "1G", + workers: utils.ToPtr[int32](2), + } + + // Define the expected Key-Value pairs based on your Params() logic + expected := params.NewKVs() + expected.Insert("Host", "127.0.0.1") + expected.Insert("port", "514") + expected.Insert("mode", "tcp") + expected.Insert("syslog_hostname_key", "hostname") + expected.Insert("syslog_appname_key", "appname") + expected.Insert("syslog_message_key", "message") + expected.Insert("syslog_format", "rfc5424") + expected.Insert("syslog_severity_key", "severity") + expected.Insert("syslog_facility_key", "facility") + expected.Insert("syslog_procid_key", "pid") // Note: matches your implementation + expected.Insert("syslog_msgid_key", "msgid") + expected.Insert("syslog_sd_key", "structured_data") // Note: matches your implementation + expected.Insert("storage.total_limit_size", "1G") + expected.Insert("syslog_maxsize", "2048") + expected.Insert("workers", "2") + + // Execute the translation + kvs, err := syslog.Params(sl) + + // Assertions + g.Expect(err).NotTo(HaveOccurred()) + g.Expect(kvs).To(Equal(expected)) +} From d472d068a3c4f17c2762c7d98115a63eb8be6136 Mon Sep 17 00:00:00 2001 From: Nick Galtry Date: Thu, 16 Apr 2026 08:59:12 +0100 Subject: [PATCH 3/3] Fixes upper and lower case for works in syslog Signed-off-by: Nick Galtry --- apis/fluentbit/v1alpha2/plugins/output/syslog_types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go b/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go index 61cb55ebf..daefd97b9 100644 --- a/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go +++ b/apis/fluentbit/v1alpha2/plugins/output/syslog_types.go @@ -46,7 +46,7 @@ type Syslog struct { // Limit the maximum number of Chunks in the filesystem for the current output logical destination. TotalLimitSize string `json:"totalLimitSize,omitempty"` // Enables dedicated thread(s) for this output. Default value is set since version 1.8.13. For previous versions is 0. - workers *int32 `json:"workers,omitempty"` + Workers *int32 `json:"workers,omitempty"` } func (*Syslog) Name() string { @@ -71,7 +71,7 @@ func (s *Syslog) Params(sl plugins.SecretLoader) (*params.KVs, error) { plugins.InsertKVString(kvs, "syslog_sd_key", s.SyslogSDKey) plugins.InsertKVString(kvs, "storage.total_limit_size", s.TotalLimitSize) plugins.InsertKVField(kvs, "syslog_maxsize", s.SyslogMaxSize) - plugins.InsertKVField(kvs, "workers", s.workers) + plugins.InsertKVField(kvs, "workers", s.Workers) if s.TLS != nil { tls, err := s.TLS.Params(sl)