diff --git a/charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_loggings.yaml b/charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_loggings.yaml index 60364329e..767cf419c 100644 --- a/charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_loggings.yaml +++ b/charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_loggings.yaml @@ -12215,6 +12215,8 @@ spec: properties: log_level: type: string + log_msg_size: + type: integer stats: properties: freq: diff --git a/charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_syslogngconfigs.yaml b/charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_syslogngconfigs.yaml index 49eb8884d..1f7bad550 100644 --- a/charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_syslogngconfigs.yaml +++ b/charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_syslogngconfigs.yaml @@ -4216,6 +4216,8 @@ spec: properties: log_level: type: string + log_msg_size: + type: integer stats: properties: freq: diff --git a/charts/logging-operator/crds/logging.banzaicloud.io_loggings.yaml b/charts/logging-operator/crds/logging.banzaicloud.io_loggings.yaml index c214b6bf1..f43bda2cf 100644 --- a/charts/logging-operator/crds/logging.banzaicloud.io_loggings.yaml +++ b/charts/logging-operator/crds/logging.banzaicloud.io_loggings.yaml @@ -12212,6 +12212,8 @@ spec: properties: log_level: type: string + log_msg_size: + type: integer stats: properties: freq: diff --git a/charts/logging-operator/crds/logging.banzaicloud.io_syslogngconfigs.yaml b/charts/logging-operator/crds/logging.banzaicloud.io_syslogngconfigs.yaml index 7b40df7e8..79d73eb89 100644 --- a/charts/logging-operator/crds/logging.banzaicloud.io_syslogngconfigs.yaml +++ b/charts/logging-operator/crds/logging.banzaicloud.io_syslogngconfigs.yaml @@ -4213,6 +4213,8 @@ spec: properties: log_level: type: string + log_msg_size: + type: integer stats: properties: freq: diff --git a/config/crd/bases/logging.banzaicloud.io_loggings.yaml b/config/crd/bases/logging.banzaicloud.io_loggings.yaml index c214b6bf1..f43bda2cf 100644 --- a/config/crd/bases/logging.banzaicloud.io_loggings.yaml +++ b/config/crd/bases/logging.banzaicloud.io_loggings.yaml @@ -12212,6 +12212,8 @@ spec: properties: log_level: type: string + log_msg_size: + type: integer stats: properties: freq: diff --git a/config/crd/bases/logging.banzaicloud.io_syslogngconfigs.yaml b/config/crd/bases/logging.banzaicloud.io_syslogngconfigs.yaml index 7b40df7e8..79d73eb89 100644 --- a/config/crd/bases/logging.banzaicloud.io_syslogngconfigs.yaml +++ b/config/crd/bases/logging.banzaicloud.io_syslogngconfigs.yaml @@ -4213,6 +4213,8 @@ spec: properties: log_level: type: string + log_msg_size: + type: integer stats: properties: freq: diff --git a/docs/configuration/crds/v1beta1/syslogng_types.md b/docs/configuration/crds/v1beta1/syslogng_types.md index 3fb3f98b2..4c145e495 100644 --- a/docs/configuration/crds/v1beta1/syslogng_types.md +++ b/docs/configuration/crds/v1beta1/syslogng_types.md @@ -143,6 +143,11 @@ SyslogNGTLS defines the TLS configs See the [AxoSyslog Core documentation](https://axoflow.com/docs/axosyslog-core/chapter-global-options/reference-options/#global-options-log-level). +### log_msg_size (*int, optional) {#globaloptions-log_msg_size} + +The maximum size of a message in bytes. Defaults to syslog-ng's built-in default of 8192 when unset. See the [AxoSyslog Core documentation](https://axoflow.com/docs/axosyslog-core/chapter-global-options/reference-options/#global-option-log-msg-size). + + ### stats (*Stats, optional) {#globaloptions-stats} See the [AxoSyslog Core documentation](https://axoflow.com/docs/axosyslog-core/chapter-global-options/reference-options/#global-option-stats). diff --git a/pkg/sdk/logging/api/v1beta1/syslogng_types.go b/pkg/sdk/logging/api/v1beta1/syslogng_types.go index ace85b9d8..38323a3fb 100644 --- a/pkg/sdk/logging/api/v1beta1/syslogng_types.go +++ b/pkg/sdk/logging/api/v1beta1/syslogng_types.go @@ -120,6 +120,9 @@ type GlobalOptions struct { Stats *Stats `json:"stats,omitempty"` // See the [AxoSyslog Core documentation](https://axoflow.com/docs/axosyslog-core/chapter-global-options/reference-options/#global-options-log-level). LogLevel *string `json:"log_level,omitempty"` + // The maximum size of a message in bytes. Defaults to syslog-ng's built-in default of 8192 when unset. + // See the [AxoSyslog Core documentation](https://axoflow.com/docs/axosyslog-core/chapter-global-options/reference-options/#global-option-log-msg-size). + LogMsgSize *int `json:"log_msg_size,omitempty"` } type Stats struct { diff --git a/pkg/sdk/logging/api/v1beta1/zz_generated.deepcopy.go b/pkg/sdk/logging/api/v1beta1/zz_generated.deepcopy.go index e33049759..e81ba25b2 100644 --- a/pkg/sdk/logging/api/v1beta1/zz_generated.deepcopy.go +++ b/pkg/sdk/logging/api/v1beta1/zz_generated.deepcopy.go @@ -1910,6 +1910,11 @@ func (in *GlobalOptions) DeepCopyInto(out *GlobalOptions) { *out = new(string) **out = **in } + if in.LogMsgSize != nil { + in, out := &in.LogMsgSize, &out.LogMsgSize + *out = new(int) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalOptions. diff --git a/pkg/sdk/logging/model/syslogng/config/config_test.go b/pkg/sdk/logging/model/syslogng/config/config_test.go index 3ceabaf54..047d3b483 100644 --- a/pkg/sdk/logging/model/syslogng/config/config_test.go +++ b/pkg/sdk/logging/model/syslogng/config/config_test.go @@ -358,6 +358,36 @@ options { stats(level(3) freq(0)); }; +source "main_input" { + channel { + source { + network(flags("no-parse") port(601) transport("tcp")); + }; + parser { + json-parser(prefix("json.")); + }; + }; +}; +`, + }, + "global options log_msg_size": { + input: Input{ + SyslogNGSpec: &v1beta1.SyslogNGSpec{ + GlobalOptions: &v1beta1.GlobalOptions{ + LogMsgSize: amp(32768), + }, + }, + SourcePort: 601, + SecretLoaderFactory: &TestSecretLoaderFactory{}, + }, + wantOut: `@version: current + +@include "scl.conf" + +options { + log_msg_size(32768); +}; + source "main_input" { channel { source {