Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ingest Manager] Stream fields removed from injected configurations #19356

Merged
merged 6 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -197,16 +197,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 @@ -247,16 +237,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