diff --git a/x-pack/elastic-agent/pkg/agent/operation/monitoring.go b/x-pack/elastic-agent/pkg/agent/operation/monitoring.go index 8242f3c3fd7..479273614a8 100644 --- a/x-pack/elastic-agent/pkg/agent/operation/monitoring.go +++ b/x-pack/elastic-agent/pkg/agent/operation/monitoring.go @@ -190,16 +190,6 @@ func (o *Operator) getMonitoringFilebeatConfig(output interface{}) (map[string]i }, }, }, - { - "add_fields": map[string]interface{}{ - "target": "stream", - "fields": map[string]interface{}{ - "type": "logs", - "dataset": "agent", - "namespace": "default", - }, - }, - }, }, }, }, @@ -240,16 +230,6 @@ func (o *Operator) getMonitoringMetricbeatConfig(output interface{}) (map[string }, }, }, - { - "add_fields": map[string]interface{}{ - "target": "stream", - "fields": map[string]interface{}{ - "type": "metrics", - "dataset": "agent", - "namespace": "default", - }, - }, - }, }, }, }, diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config-filebeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config-filebeat.yml index c0e520115ec..31e7b27eafd 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config-filebeat.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config-filebeat.yml @@ -12,12 +12,6 @@ filebeat: type: logs name: generic namespace: default - - add_fields: - target: "stream" - fields: - type: logs - dataset: generic - namespace: default output: elasticsearch: hosts: diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_output_true-filebeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_output_true-filebeat.yml index 0b8bcd47132..97b9e529bc6 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_output_true-filebeat.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_output_true-filebeat.yml @@ -12,12 +12,6 @@ filebeat: type: logs name: generic namespace: default - - add_fields: - target: "stream" - fields: - type: logs - dataset: generic - namespace: default output: elasticsearch: enabled: true diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_true-filebeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_true-filebeat.yml index d655f5dd5e1..080303e6d19 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_true-filebeat.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/enabled_true-filebeat.yml @@ -13,12 +13,6 @@ filebeat: type: logs name: generic namespace: default - - add_fields: - target: "stream" - fields: - type: logs - dataset: generic - namespace: default output: elasticsearch: hosts: diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-filebeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-filebeat.yml index 7d60c10fb02..25b7af4e40a 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-filebeat.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-filebeat.yml @@ -14,12 +14,6 @@ filebeat: type: logs name: generic namespace: default - - add_fields: - target: "stream" - fields: - type: logs - dataset: generic - namespace: default - type: log paths: - /var/log/hello3.log @@ -34,12 +28,6 @@ filebeat: type: testtype name: generic namespace: default - - add_fields: - target: "stream" - fields: - type: testtype - dataset: generic - namespace: default output: elasticsearch: hosts: diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-metricbeat.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-metricbeat.yml index df6ac491bb8..2e5e070dfb1 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-metricbeat.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-metricbeat.yml @@ -11,12 +11,6 @@ metricbeat: type: metrics name: docker.status namespace: default - - add_fields: - target: "stream" - fields: - type: metrics - dataset: docker.status - namespace: default - module: docker metricsets: [info] index: metrics-generic-default @@ -28,12 +22,6 @@ metricbeat: type: metrics name: generic namespace: default - - add_fields: - target: "stream" - fields: - type: metrics - dataset: generic - namespace: default - module: apache metricsets: [info] index: metrics-generic-testing @@ -48,12 +36,6 @@ metricbeat: type: metrics name: generic namespace: testing - - add_fields: - target: "stream" - fields: - type: metrics - dataset: generic - namespace: testing output: elasticsearch: diff --git a/x-pack/elastic-agent/pkg/agent/transpiler/rules.go b/x-pack/elastic-agent/pkg/agent/transpiler/rules.go index 3fbeb396db2..fe63f0e94e5 100644 --- a/x-pack/elastic-agent/pkg/agent/transpiler/rules.go +++ b/x-pack/elastic-agent/pkg/agent/transpiler/rules.go @@ -603,20 +603,6 @@ func (r *InjectStreamProcessorRule) Apply(ast *AST) error { addFieldsMap := &Dict{value: []Node{&Key{"add_fields", processorMap}}} processorsList.value = mergeStrategy(r.OnConflict).InjectItem(processorsList.value, addFieldsMap) - - // add this for backwards compatibility remove later - streamProcessorMap := &Dict{value: make([]Node, 0)} - streamProcessorMap.value = append(streamProcessorMap.value, &Key{name: "target", value: &StrVal{value: "stream"}}) - streamProcessorMap.value = append(streamProcessorMap.value, &Key{name: "fields", value: &Dict{value: []Node{ - &Key{name: "type", value: &StrVal{value: datasetType}}, - &Key{name: "namespace", value: &StrVal{value: namespace}}, - &Key{name: "dataset", value: &StrVal{value: dataset}}, - }}}) - - streamAddFieldsMap := &Dict{value: []Node{&Key{"add_fields", streamProcessorMap}}} - - processorsList.value = mergeStrategy(r.OnConflict).InjectItem(processorsList.value, streamAddFieldsMap) - // end of backward compatibility section } }