Skip to content

Commit

Permalink
[Ingest Manager] Stream fields removed from injected configurations (e…
Browse files Browse the repository at this point in the history
…lastic#19356)

* removed

* updated tests

* Update go.sum

* monitoring data
  • Loading branch information
michalpristas committed Jun 25, 2020
1 parent 3987057 commit bfb0047
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 82 deletions.
20 changes: 0 additions & 20 deletions x-pack/elastic-agent/pkg/agent/operation/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
},
},
},
},
Expand Down Expand Up @@ -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",
},
},
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -48,12 +36,6 @@ metricbeat:
type: metrics
name: generic
namespace: testing
- add_fields:
target: "stream"
fields:
type: metrics
dataset: generic
namespace: testing

output:
elasticsearch:
Expand Down
14 changes: 0 additions & 14 deletions x-pack/elastic-agent/pkg/agent/transpiler/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit bfb0047

Please sign in to comment.