Skip to content
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
14 changes: 7 additions & 7 deletions internal/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func NewApp(cfg *config.Config, options ...Option) (*App, error) {
var engine *rules.Engine
var rs *config.RulesCompileResult

if cfg.Filters.Rules.Enabled && !cfg.ForwardMode && !cfg.IsCaptureSet() {
if cfg.Filters.Rules.Enabled && !cfg.ForwardMode && !cfg.IsCaptureSet() && !cfg.IsFilamentSet() {
engine = rules.NewEngine(psnap, cfg)
var err error
rs, err = engine.Compile()
Expand Down Expand Up @@ -203,9 +203,8 @@ func (f *App) Run(args []string) error {
// In case of a regular run, we additionally set up the aggregator.
// The aggregator will grab the events from the queue, assemble them
// into batches and hand over to output sinks.
filamentName := cfg.Filament.Name
if filamentName != "" {
f.filament, err = filament.New(filamentName, f.psnap, f.hsnap, cfg)
if cfg.IsFilamentSet() {
f.filament, err = filament.New(cfg.Filament.Name, f.psnap, f.hsnap, cfg)
if err != nil {
return err
}
Expand Down Expand Up @@ -314,9 +313,9 @@ func (f *App) ReadCapture(ctx context.Context, args []string) error {
if err != nil {
return err
}
filamentName := f.config.Filament.Name
if filamentName != "" {
f.filament, err = filament.New(filamentName, f.psnap, f.hsnap, f.config)

if f.config.IsFilamentSet() {
f.filament, err = filament.New(f.config.Filament.Name, f.psnap, f.hsnap, f.config)
if err != nil {
return err
}
Expand Down Expand Up @@ -355,6 +354,7 @@ func (f *App) ReadCapture(ctx context.Context, args []string) error {
return err
}
}

return api.StartServer(f.config)
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/config/config_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ func (c *Config) Init() error {
// in the capture file.
func (c *Config) IsCaptureSet() bool { return c.CapFile != "" }

// IsFilamentSet indicates if the filament is supplied.
func (c *Config) IsFilamentSet() bool { return c.Filament.Name != "" }

// TryLoadFile attempts to load the configuration file from specified path on the file system.
func (c *Config) TryLoadFile(file string) error {
c.viper.SetConfigFile(file)
Expand Down