From 46238f3ab8a2a2b8440f58c9215f1abef18ee516 Mon Sep 17 00:00:00 2001 From: Tiago Queiroz Date: Thu, 6 Oct 2022 11:42:48 +0200 Subject: [PATCH] Fix docker provider add_fields processors The Docker provider was using a wrong key when defining the `add_fields` processor, this causes Filebeat not to start the input and stay on a unhealthy state. This processor seems to be defined every time a variable like `${docker}` is used on a input configuration. This commig fixes it. --- x-pack/elastic-agent/CHANGELOG.next.asciidoc | 1 + x-pack/elastic-agent/pkg/composable/providers/docker/docker.go | 2 +- .../pkg/composable/providers/docker/docker_test.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/x-pack/elastic-agent/CHANGELOG.next.asciidoc b/x-pack/elastic-agent/CHANGELOG.next.asciidoc index c14a4e7b42b..d434fdb3f40 100644 --- a/x-pack/elastic-agent/CHANGELOG.next.asciidoc +++ b/x-pack/elastic-agent/CHANGELOG.next.asciidoc @@ -96,6 +96,7 @@ - Allow ':' characters in dynamic variables. {pull}32407[32407] - Allow the - char to appear as part of variable names in eql expressions. {pull}32350[32350] - Allow the / char to appear as part of variable names in eql expressions. {pull}32528{32528} +- Fix add_fields processor on Docker provider {pull}33269{33269} ==== New features diff --git a/x-pack/elastic-agent/pkg/composable/providers/docker/docker.go b/x-pack/elastic-agent/pkg/composable/providers/docker/docker.go index ad49bac6288..ea7cc4881e8 100644 --- a/x-pack/elastic-agent/pkg/composable/providers/docker/docker.go +++ b/x-pack/elastic-agent/pkg/composable/providers/docker/docker.go @@ -145,7 +145,7 @@ func generateData(event bus.Event) (*dockerContainerData, error) { "image": container.Image, "labels": processorLabelMap, }, - "to": "container", + "target": "container", }, }, }, diff --git a/x-pack/elastic-agent/pkg/composable/providers/docker/docker_test.go b/x-pack/elastic-agent/pkg/composable/providers/docker/docker_test.go index 55cf2f3a238..417e53c5638 100644 --- a/x-pack/elastic-agent/pkg/composable/providers/docker/docker_test.go +++ b/x-pack/elastic-agent/pkg/composable/providers/docker/docker_test.go @@ -53,7 +53,7 @@ func TestGenerateData(t *testing.T) { "co_elastic_logs/disable": "true", }, }, - "to": "container", + "target": "container", }, }, }