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 2 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
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/eclipse/paho.mqtt.golang v1.2.1-0.20200121105743-0d940dd29fd2 h1:DW6WrARxK5J+o8uAKCiACi5wy9EK1UzrsCpGBPsKHAA=
github.com/eclipse/paho.mqtt.golang v1.2.1-0.20200121105743-0d940dd29fd2/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts=
github.com/elastic/beats v7.6.2+incompatible h1:jHdLv83KURaqWUC6f55iMyVP6LYZrgElfeqxKWcskVE=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no this is just my vscode

github.com/elastic/dhcp v0.0.0-20200227161230-57ec251c7eb3 h1:lnDkqiRFKm0rxdljqrj3lotWinO9+jFmeDXIC4gvIQs=
github.com/elastic/dhcp v0.0.0-20200227161230-57ec251c7eb3/go.mod h1:aPqzac6AYkipvp4hufTyMj5PDIphF3+At8zr7r51xjY=
github.com/elastic/ecs v1.5.0 h1:/VEIBsRU4ecq2+U3RPfKNc6bFyomP6qnthYEcQZu8GU=
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