Skip to content

Commit

Permalink
Don't instantiate MetricSets with the setup command (elastic#7112)
Browse files Browse the repository at this point in the history
This will allow `auditbeat setup` to run without requiring elevated privileges
to create the audit socket.

Fixes elastic#7111
  • Loading branch information
andrewkroh authored and stevea78 committed May 20, 2018
1 parent b32f92d commit 67ed5c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ https://github.com/elastic/beats/compare/v6.2.3...master[Check the HEAD diff]
- Add hex decoding for the name field in audit path records. {pull}6687[6687]
- Fixed a deadlock in the file_integrity module under Windows. {issue}6864[6864]
- Fixed parsing of AppArmor audit messages. {pull}6978[6978]
- Allow `auditbeat setup` to run without requiring elevated privileges for the audit client. {issue}7111[7111]

*Filebeat*

Expand Down
5 changes: 5 additions & 0 deletions metricbeat/beater/metricbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ func newMetricbeat(b *beat.Beat, c *common.Config, options ...Option) (*Metricbe
applyOption(metricbeat)
}

if b.InSetupCmd {
// Return without instantiating the metricsets.
return metricbeat, nil
}

moduleOptions := append(
[]module.Option{module.WithMaxStartDelay(config.MaxStartDelay)},
metricbeat.moduleOptions...)
Expand Down

0 comments on commit 67ed5c8

Please sign in to comment.