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

Add fileset for parsing linux auditd logs #3750

Merged
merged 4 commits into from
Apr 3, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Apply fileset overrides before checking enabled
Disable other filesets in a module while testing.
  • Loading branch information
andrewkroh committed Mar 17, 2017
commit c945fb73c04a60e3f853b893473af01d28cf1d3a
8 changes: 4 additions & 4 deletions filebeat/fileset/modules.go
Original file line number Diff line number Diff line change
@@ -44,15 +44,15 @@ func newModuleRegistry(modulesPath string,
fcfg = &defaultFilesetConfig
}

if fcfg.Enabled != nil && (*fcfg.Enabled) == false {
continue
}

fcfg, err = applyOverrides(fcfg, mcfg.Module, filesetName, overrides)
if err != nil {
return nil, fmt.Errorf("Error applying overrides on fileset %s/%s: %v", mcfg.Module, filesetName, err)
}

if fcfg.Enabled != nil && (*fcfg.Enabled) == false {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason this was moved?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies the overrides first, which allows an override to disable a fileset. It allows a CLI config like:

-M system.audit.enabled=false

continue
}

fileset, err := New(modulesPath, filesetName, &mcfg, fcfg)
if err != nil {
return nil, err
2 changes: 2 additions & 0 deletions filebeat/tests/system/test_modules.py
Original file line number Diff line number Diff line change
@@ -74,6 +74,8 @@ def run_on_file(self, module, fileset, test_file, cfgfile):
"-e", "-d", "*", "-once",
"-c", cfgfile,
"-modules={}".format(module),
"-M", "{module}.*.enabled=false".format(module=module),
"-M", "{module}.{fileset}.enabled=true".format(module=module, fileset=fileset),
"-M", "{module}.{fileset}.var.paths=[{test_file}]".format(
module=module, fileset=fileset, test_file=test_file),
"-M", "*.*.prospector.close_eof=true",