Skip to content

Commit

Permalink
[Packetbeat] Split out elastic-agent config changes (elastic#22145)
Browse files Browse the repository at this point in the history
* Split out elastic-agent config changes

* update test fixtures

* Remove bundled packetbeat

* unnest inputs

* Change input to type packet

* Revert "Remove bundled packetbeat"

This reverts commit a89fe1a.

* Revert "Revert "Remove bundled packetbeat""

This reverts commit 48d5f0e.
  • Loading branch information
Andrew Stucki authored Nov 16, 2020
1 parent 36f28bf commit af4007e
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 3 deletions.
4 changes: 2 additions & 2 deletions x-pack/elastic-agent/pkg/agent/program/program_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ func TestConfiguration(t *testing.T) {
err bool
}{
"single_config": {
programs: []string{"filebeat", "heartbeat", "metricbeat", "endpoint"},
expected: 4,
programs: []string{"filebeat", "heartbeat", "metricbeat", "endpoint", "packetbeat"},
expected: 5,
},
// "audit_config": {
// programs: []string{"auditbeat"},
Expand Down
3 changes: 2 additions & 1 deletion x-pack/elastic-agent/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
@@ -0,0 +1,30 @@
inputs:
- type: packet
processors:
- add_fields:
target: 'elastic_agent'
fields:
id: agent-id
version: 8.0.0
snapshot: false
streams:
- type: flow
timeout: 10s
period: 10s
keep_null: false
data_stream:
dataset: packet.flow
type: logs
- type: icmp
data_stream:
dataset: packet.icmp
type: logs
output:
elasticsearch:
hosts:
- 127.0.0.1:9200
- 127.0.0.1:9300
username: elastic
password: changeme
api_key: TiNAGG4BaaMdaH1tRfuU:KnR6yE41RrSowb0kQ0HWoA
ca_sha256: 7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=
13 changes: 13 additions & 0 deletions x-pack/elastic-agent/pkg/agent/program/testdata/single_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ inputs:
host: "http://localhost:80/service/status"
timeout: 16s
wait: 1s
- type: packet
streams:
- type: flow
timeout: 10s
period: 10s
keep_null: false
data_stream:
dataset: packet.flow
type: logs
- type: icmp
data_stream:
dataset: packet.icmp
type: logs
- id: endpoint-id
type: endpoint
name: endpoint-1
Expand Down
21 changes: 21 additions & 0 deletions x-pack/elastic-agent/spec/packetbeat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Packetbeat
cmd: packetbeat
args: ['-E', 'setup.ilm.enabled=false', '-E', 'setup.template.enabled=false', '-E', 'management.mode=x-pack-fleet', '-E', 'management.enabled=true', '-E', 'logging.level=debug']
artifact: beats/packetbeat
rules:
- filter_values:
selector: inputs
key: type
values:
- packet

- inject_agent_info: {}

- filter:
selectors:
- inputs
- output

when: length(${inputs}) > 0 and hasKey(${output}, 'elasticsearch', 'redis',
'kafka', 'logstash')

0 comments on commit af4007e

Please sign in to comment.