diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index a10ceba2da8..cc505b4ad8f 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -149,6 +149,7 @@ automatic splitting at root level, if root level element is an array. {pull}3415 - Fix project monitor temp directories permission to include group access. {pull}35398[35398] - Fix output pipeline exit on run_once. {pull}35376[35376] - Fix formatting issue with socket trace timeout. {pull}35434[35434] +- Fix serialization of processors when running diagnostics. {pull}35698[35698] *Heartbeat* diff --git a/libbeat/publisher/processing/default.go b/libbeat/publisher/processing/default.go index a8ec007562e..e3a2c961a92 100644 --- a/libbeat/publisher/processing/default.go +++ b/libbeat/publisher/processing/default.go @@ -261,9 +261,13 @@ func newBuilder( // Processors returns a string description of the processor config func (b *builder) Processors() []string { procList := []string{} - for _, proc := range b.processors.list { - procList = append(procList, proc.String()) + + if b.processors != nil { + for _, proc := range b.processors.list { + procList = append(procList, proc.String()) + } } + return procList } diff --git a/libbeat/publisher/processing/default_test.go b/libbeat/publisher/processing/default_test.go index ef58dc97b8e..6fe05785037 100644 --- a/libbeat/publisher/processing/default_test.go +++ b/libbeat/publisher/processing/default_test.go @@ -480,6 +480,14 @@ func TestProcessingClose(t *testing.T) { assert.True(t, factoryProcessor.closed) } +func TestProcessingDiagnostics(t *testing.T) { + factory, err := MakeDefaultSupport(true, nil)(beat.Info{}, logp.L(), config.NewConfig()) + require.NoError(t, err) + + p := factory.Processors() + assert.Empty(t, p) +} + func fromJSON(in string) mapstr.M { var tmp mapstr.M err := json.Unmarshal([]byte(in), &tmp)