Skip to content

Commit

Permalink
[8.3](backport #700) Fix for the filebeat spec file picking up packet…
Browse files Browse the repository at this point in the history
…beat inputs (#723)

* Fix for the filebeat spec file picking up packetbeat inputs (#700)

* Reproduce filebeat picking up packetbeat inputs

* Filebeat: filter inputs as first input transform.

Move input filtering to be the first input transformation that occurs in
the filebeat spec file. Fixes
#427.

* Update changelog.

(cherry picked from commit 4dcc16b)

# Conflicts:
#	internal/pkg/agent/program/supported.go

* Fix merge conflicts

Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co>
  • Loading branch information
mergify[bot] and cmacknz authored Jul 14, 2022
1 parent 89b0991 commit 4a2e961
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,4 @@
- Save the agent configuration and the state encrypted on the disk. {issue}535[535] {pull}398[398]
- Bump node.js version for heartbeat/synthetics to 16.15.0
- Support scheduled actions and cancellation of pending actions. {issue}393[393] {pull}419[419]
- Fix incorrectly creating a filebeat redis input when a policy contains a packetbeat redis input. {issue}[427] {pull}[700]
2 changes: 1 addition & 1 deletion internal/pkg/agent/program/supported.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ inputs:
data_stream:
dataset: packet.icmp
type: logs
- id: packet-network_traffic.redis-387bdc6a-0acb-4ef2-9552-c21e524a2d21
type: redis
data_stream:
dataset: network_traffic.redis
type: logs
ports:
- 6379
output:
elasticsearch:
hosts:
Expand Down
7 changes: 7 additions & 0 deletions internal/pkg/agent/program/testdata/single_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ inputs:
data_stream:
dataset: packet.icmp
type: logs
- id: packet-network_traffic.redis-387bdc6a-0acb-4ef2-9552-c21e524a2d21
type: redis
data_stream:
dataset: network_traffic.redis
type: logs
ports:
- 6379
- id: endpoint-id
type: endpoint
name: endpoint-1
Expand Down
66 changes: 38 additions & 28 deletions internal/spec/filebeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,44 @@ rules:
on_conflict: insert_after
type: logs

# Input filtering needs to happen before any other input transformations.
# See https://github.com/elastic/elastic-agent/issues/427.
- filter_values:
selector: inputs
key: type
values:
- aws-cloudwatch
- aws-s3
- azure-eventhub
- cloudfoundry
- container
- docker
- event/file
- event/stdin
- event/tcp
- event/udp
- filestream
- gcp-pubsub
- http_endpoint
- httpjson
- journald
- kafka
- log
- log/docker
- log/redis_slowlog
- log/syslog
- logfile
- mqtt
- netflow
- o365audit
- redis
- stdin
- syslog
- tcp
- udp
- unix
- winlog

- map:
path: inputs
rules:
Expand Down Expand Up @@ -63,34 +101,6 @@ rules:
- remove_key:
key: data_stream.dataset

- filter_values:
selector: inputs
key: type
values:
- aws-cloudwatch
- aws-s3
- azure-eventhub
- cloudfoundry
- container
- docker
- gcp-pubsub
- http_endpoint
- httpjson
- journald
- kafka
- log
- mqtt
- netflow
- o365audit
- redis
- stdin
- syslog
- tcp
- udp
- unix
- winlog
- filestream

- filter_values:
selector: inputs
key: enabled
Expand Down

0 comments on commit 4a2e961

Please sign in to comment.