Skip to content

Commit b406e21

Browse files
feat(syslog-ng): expose log_msg_size global option
Add the log_msg_size global option to SyslogNGSpec.GlobalOptions so users can override syslog-ng's built-in default of 8192 bytes. When unset, nothing is rendered and syslog-ng keeps its native default.
1 parent 5ceb571 commit b406e21

10 files changed

Lines changed: 55 additions & 0 deletions

File tree

charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_loggings.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12215,6 +12215,8 @@ spec:
1221512215
properties:
1221612216
log_level:
1221712217
type: string
12218+
log_msg_size:
12219+
type: integer
1221812220
stats:
1221912221
properties:
1222012222
freq:

charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_syslogngconfigs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4216,6 +4216,8 @@ spec:
42164216
properties:
42174217
log_level:
42184218
type: string
4219+
log_msg_size:
4220+
type: integer
42194221
stats:
42204222
properties:
42214223
freq:

charts/logging-operator/crds/logging.banzaicloud.io_loggings.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12212,6 +12212,8 @@ spec:
1221212212
properties:
1221312213
log_level:
1221412214
type: string
12215+
log_msg_size:
12216+
type: integer
1221512217
stats:
1221612218
properties:
1221712219
freq:

charts/logging-operator/crds/logging.banzaicloud.io_syslogngconfigs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4213,6 +4213,8 @@ spec:
42134213
properties:
42144214
log_level:
42154215
type: string
4216+
log_msg_size:
4217+
type: integer
42164218
stats:
42174219
properties:
42184220
freq:

config/crd/bases/logging.banzaicloud.io_loggings.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12212,6 +12212,8 @@ spec:
1221212212
properties:
1221312213
log_level:
1221412214
type: string
12215+
log_msg_size:
12216+
type: integer
1221512217
stats:
1221612218
properties:
1221712219
freq:

config/crd/bases/logging.banzaicloud.io_syslogngconfigs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4213,6 +4213,8 @@ spec:
42134213
properties:
42144214
log_level:
42154215
type: string
4216+
log_msg_size:
4217+
type: integer
42164218
stats:
42174219
properties:
42184220
freq:

docs/configuration/crds/v1beta1/syslogng_types.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ SyslogNGTLS defines the TLS configs
143143
See the [AxoSyslog Core documentation](https://axoflow.com/docs/axosyslog-core/chapter-global-options/reference-options/#global-options-log-level).
144144

145145

146+
### log_msg_size (*int, optional) {#globaloptions-log_msg_size}
147+
148+
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).
149+
150+
146151
### stats (*Stats, optional) {#globaloptions-stats}
147152

148153
See the [AxoSyslog Core documentation](https://axoflow.com/docs/axosyslog-core/chapter-global-options/reference-options/#global-option-stats).

pkg/sdk/logging/api/v1beta1/syslogng_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ type GlobalOptions struct {
120120
Stats *Stats `json:"stats,omitempty"`
121121
// See the [AxoSyslog Core documentation](https://axoflow.com/docs/axosyslog-core/chapter-global-options/reference-options/#global-options-log-level).
122122
LogLevel *string `json:"log_level,omitempty"`
123+
// The maximum size of a message in bytes. Defaults to syslog-ng's built-in default of 8192 when unset.
124+
// See the [AxoSyslog Core documentation](https://axoflow.com/docs/axosyslog-core/chapter-global-options/reference-options/#global-option-log-msg-size).
125+
LogMsgSize *int `json:"log_msg_size,omitempty"`
123126
}
124127

125128
type Stats struct {

pkg/sdk/logging/api/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/sdk/logging/model/syslogng/config/config_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,36 @@ options {
358358
stats(level(3) freq(0));
359359
};
360360
361+
source "main_input" {
362+
channel {
363+
source {
364+
network(flags("no-parse") port(601) transport("tcp"));
365+
};
366+
parser {
367+
json-parser(prefix("json."));
368+
};
369+
};
370+
};
371+
`,
372+
},
373+
"global options log_msg_size": {
374+
input: Input{
375+
SyslogNGSpec: &v1beta1.SyslogNGSpec{
376+
GlobalOptions: &v1beta1.GlobalOptions{
377+
LogMsgSize: amp(32768),
378+
},
379+
},
380+
SourcePort: 601,
381+
SecretLoaderFactory: &TestSecretLoaderFactory{},
382+
},
383+
wantOut: `@version: current
384+
385+
@include "scl.conf"
386+
387+
options {
388+
log_msg_size(32768);
389+
};
390+
361391
source "main_input" {
362392
channel {
363393
source {

0 commit comments

Comments
 (0)