Skip to content
Merged
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
10 changes: 6 additions & 4 deletions x-pack/osquerybeat/beater/osquerybeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const (
// The interval in second for configuration refresh;
// osqueryd child process requests configuration from the configuration plugin implemented in osquerybeat
configurationRefreshIntervalSecs = 60

osqueryTimeout = 60 * time.Second
)

const (
Expand Down Expand Up @@ -176,7 +178,7 @@ func (bt *osquerybeat) Run(b *beat.Beat) error {
// Create osqueryd client
cli := osqdcli.New(socketPath,
osqdcli.WithLogger(bt.log),
osqdcli.WithTimeout(3*time.Second),
osqdcli.WithTimeout(osqueryTimeout),
osqdcli.WithCache(cache, adhocOsqueriesTypesCacheSize),
)

Expand All @@ -201,7 +203,7 @@ func (bt *osquerybeat) Run(b *beat.Beat) error {

// Start osquery extensions for logger and configuration
g.Go(func() error {
return runExtensionServer(ctx, socketPath, configPlugin, loggerPlugin)
return runExtensionServer(ctx, socketPath, configPlugin, loggerPlugin, osqueryTimeout)
})

// Register action handler
Expand Down Expand Up @@ -246,9 +248,9 @@ func (bt *osquerybeat) Run(b *beat.Beat) error {
return g.Wait()
}

func runExtensionServer(ctx context.Context, socketPath string, configPlugin *ConfigPlugin, loggerPlugin *LoggerPlugin) (err error) {
func runExtensionServer(ctx context.Context, socketPath string, configPlugin *ConfigPlugin, loggerPlugin *LoggerPlugin, timeout time.Duration) (err error) {
// Register config and logger extensions
extserver, err := osquery.NewExtensionManagerServer(extManagerServerName, socketPath)
extserver, err := osquery.NewExtensionManagerServer(extManagerServerName, socketPath, osquery.ServerTimeout(timeout))
if err != nil {
return
}
Expand Down