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

Cherry-pick #22145 to 7.x: [Packetbeat] Split out elastic-agent config changes #22600

Merged
merged 1 commit into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
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')