diff --git a/filebeat/_meta/common.full.p2.yml b/filebeat/_meta/common.full.p2.yml index a70f75f00a8..6fdaa8cd4a8 100644 --- a/filebeat/_meta/common.full.p2.yml +++ b/filebeat/_meta/common.full.p2.yml @@ -16,6 +16,9 @@ filebeat.prospectors: #------------------------------ Log prospector -------------------------------- - input_type: log + # Change to true to enable this prospector configuration. + enabled: false + # Paths that should be crawled and fetched. Glob based paths. # To fetch all ".log" files from a specific level of subdirectories # /var/log/*/*.log can be used. diff --git a/filebeat/_meta/common.p2.yml b/filebeat/_meta/common.p2.yml index c7889efe882..80d7d03cc69 100644 --- a/filebeat/_meta/common.p2.yml +++ b/filebeat/_meta/common.p2.yml @@ -11,6 +11,9 @@ filebeat.prospectors: - input_type: log + # Change to true to enable this prospector configuration. + enabled: false + # Paths that should be crawled and fetched. Glob based paths. paths: - /var/log/*.log diff --git a/filebeat/beater/filebeat.go b/filebeat/beater/filebeat.go index 3d766d316d6..48d422c2dc7 100644 --- a/filebeat/beater/filebeat.go +++ b/filebeat/beater/filebeat.go @@ -57,8 +57,16 @@ func New(b *beat.Beat, rawConfig *common.Config) (beat.Beater, error) { // Add prospectors created by the modules config.Prospectors = append(config.Prospectors, moduleProspectors...) - if !config.ConfigProspector.Enabled() && len(config.Prospectors) == 0 { - return nil, errors.New("No prospectors defined. What files do you want me to watch?") + haveEnabledProspectors := false + for _, prospector := range config.Prospectors { + if prospector.Enabled() { + haveEnabledProspectors = true + break + } + } + + if !config.ConfigProspector.Enabled() && !haveEnabledProspectors { + return nil, errors.New("No modules or prospectors enabled and configuration reloading disabled. What files do you want me to watch?") } if *once && config.ConfigProspector.Enabled() { diff --git a/filebeat/filebeat.full.yml b/filebeat/filebeat.full.yml index 18ef8a7a576..6027f6c7568 100644 --- a/filebeat/filebeat.full.yml +++ b/filebeat/filebeat.full.yml @@ -25,17 +25,24 @@ filebeat.modules: # can be added under this section. #prospector: + # Authorization logs + #auth: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Prospector configuration (advanced). Any prospector configuration option + # can be added under this section. + #prospector: + #------------------------------- Apache2 Module ------------------------------ #- module: apache2 # Access logs #access: #enabled: true - # Ingest Node pipeline to use. Options are `with_plugins` (default) - # and `no_plugins`. Use `no_plugins` if you don't have the geoip or - # the user agent Node ingest plugins installed. - #var.pipeline: with_plugins - # Set custom paths for the log files. If left empty, # Filebeat will choose the paths depending on your OS. #var.paths: @@ -139,11 +146,6 @@ filebeat.modules: #access: #enabled: true - # Ingest Node pipeline to use. Options are `with_plugins` (default) - # and `no_plugins`. Use `no_plugins` if you don't have the geoip or - # the user agent Node ingest plugins installed. - #var.pipeline: with_plugins - # Set custom paths for the log files. If left empty, # Filebeat will choose the paths depending on your OS. #var.paths: @@ -183,6 +185,9 @@ filebeat.prospectors: #------------------------------ Log prospector -------------------------------- - input_type: log + # Change to true to enable this prospector configuration. + enabled: false + # Paths that should be crawled and fetched. Glob based paths. # To fetch all ".log" files from a specific level of subdirectories # /var/log/*/*.log can be used. diff --git a/filebeat/filebeat.yml b/filebeat/filebeat.yml index 545eac7b54a..790eee22a01 100644 --- a/filebeat/filebeat.yml +++ b/filebeat/filebeat.yml @@ -13,19 +13,85 @@ filebeat.modules: #------------------------------- System Module ------------------------------- #- module: system + # Syslog + #syslog: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Authorization logs + #auth: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + +#------------------------------- Apache2 Module ------------------------------ +#- module: apache2 + # Access logs + #access: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Error logs + #error: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: #------------------------------- Auditd Module ------------------------------- #- module: auditd + #log: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + #-------------------------------- MySQL Module ------------------------------- #- module: mysql + # Error logs + #error: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Slow logs + #slowlog: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: #-------------------------------- Nginx Module ------------------------------- #- module: nginx - # Ingest Node pipeline to use. Options are `with_plugins` (default) - # and `no_plugins`. Use `no_plugins` if you don't have the geoip or - # the user agent Node ingest plugins installed. - #access.var.pipeline: with_plugins + # Access logs + #access: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Error logs + #error: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: # For more available modules and options, please see the filebeat.full.yml sample @@ -41,6 +107,9 @@ filebeat.prospectors: - input_type: log + # Change to true to enable this prospector configuration. + enabled: false + # Paths that should be crawled and fetched. Glob based paths. paths: - /var/log/*.log diff --git a/filebeat/module/apache2/_meta/config.full.yml b/filebeat/module/apache2/_meta/config.full.yml index 44481fee9a8..91117963687 100644 --- a/filebeat/module/apache2/_meta/config.full.yml +++ b/filebeat/module/apache2/_meta/config.full.yml @@ -3,11 +3,6 @@ #access: #enabled: true - # Ingest Node pipeline to use. Options are `with_plugins` (default) - # and `no_plugins`. Use `no_plugins` if you don't have the geoip or - # the user agent Node ingest plugins installed. - #var.pipeline: with_plugins - # Set custom paths for the log files. If left empty, # Filebeat will choose the paths depending on your OS. #var.paths: diff --git a/filebeat/module/apache2/_meta/config.yml b/filebeat/module/apache2/_meta/config.yml new file mode 100644 index 00000000000..6ccb548ad4f --- /dev/null +++ b/filebeat/module/apache2/_meta/config.yml @@ -0,0 +1,16 @@ +#- module: apache2 + # Access logs + #access: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Error logs + #error: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: diff --git a/filebeat/module/auditd/_meta/config.yml b/filebeat/module/auditd/_meta/config.yml index 844a9b2ee1a..5669924ba0b 100644 --- a/filebeat/module/auditd/_meta/config.yml +++ b/filebeat/module/auditd/_meta/config.yml @@ -1 +1,8 @@ #- module: auditd + #log: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + diff --git a/filebeat/module/icinga/_meta/config.yml b/filebeat/module/icinga/_meta/config.yml index 54e3e9fa68a..7657f4467ee 100644 --- a/filebeat/module/icinga/_meta/config.yml +++ b/filebeat/module/icinga/_meta/config.yml @@ -1 +1,24 @@ #- module: icinga + # Main logs + #main: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Debug logs + #debug: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Startup logs + #startup: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: diff --git a/filebeat/module/mysql/_meta/config.yml b/filebeat/module/mysql/_meta/config.yml index 22942e984f0..aadb5631092 100644 --- a/filebeat/module/mysql/_meta/config.yml +++ b/filebeat/module/mysql/_meta/config.yml @@ -1 +1,16 @@ #- module: mysql + # Error logs + #error: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Slow logs + #slowlog: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: diff --git a/filebeat/module/nginx/_meta/config.full.yml b/filebeat/module/nginx/_meta/config.full.yml index f80f92dbc3b..249d1bdb22f 100644 --- a/filebeat/module/nginx/_meta/config.full.yml +++ b/filebeat/module/nginx/_meta/config.full.yml @@ -3,11 +3,6 @@ #access: #enabled: true - # Ingest Node pipeline to use. Options are `with_plugins` (default) - # and `no_plugins`. Use `no_plugins` if you don't have the geoip or - # the user agent Node ingest plugins installed. - #var.pipeline: with_plugins - # Set custom paths for the log files. If left empty, # Filebeat will choose the paths depending on your OS. #var.paths: diff --git a/filebeat/module/nginx/_meta/config.yml b/filebeat/module/nginx/_meta/config.yml index ae1f0dd933d..e1b45939726 100644 --- a/filebeat/module/nginx/_meta/config.yml +++ b/filebeat/module/nginx/_meta/config.yml @@ -1,5 +1,16 @@ #- module: nginx - # Ingest Node pipeline to use. Options are `with_plugins` (default) - # and `no_plugins`. Use `no_plugins` if you don't have the geoip or - # the user agent Node ingest plugins installed. - #access.var.pipeline: with_plugins + # Access logs + #access: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Error logs + #error: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: diff --git a/filebeat/module/system/_meta/config.full.yml b/filebeat/module/system/_meta/config.full.yml index eef3fa9aaf2..266677dc118 100644 --- a/filebeat/module/system/_meta/config.full.yml +++ b/filebeat/module/system/_meta/config.full.yml @@ -10,3 +10,15 @@ # Prospector configuration (advanced). Any prospector configuration option # can be added under this section. #prospector: + + # Authorization logs + #auth: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Prospector configuration (advanced). Any prospector configuration option + # can be added under this section. + #prospector: diff --git a/filebeat/module/system/_meta/config.yml b/filebeat/module/system/_meta/config.yml index 010586ba9b4..d31ca8bc6ea 100644 --- a/filebeat/module/system/_meta/config.yml +++ b/filebeat/module/system/_meta/config.yml @@ -1 +1,16 @@ #- module: system + # Syslog + #syslog: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: + + # Authorization logs + #auth: + #enabled: true + + # Set custom paths for the log files. If left empty, + # Filebeat will choose the paths depending on your OS. + #var.paths: diff --git a/filebeat/tests/system/test_prospector.py b/filebeat/tests/system/test_prospector.py index c704ae34193..1b746af0a6c 100644 --- a/filebeat/tests/system/test_prospector.py +++ b/filebeat/tests/system/test_prospector.py @@ -276,14 +276,9 @@ def test_shutdown_no_prospectors(self): filebeat = self.start_beat() - # wait for first "Start next scan" log message self.wait_until( lambda: self.log_contains( - "No prospectors defined"), - max_timeout=10) - - self.wait_until( - lambda: self.log_contains("No prospectors defined"), + "No modules or prospectors enabled"), max_timeout=10) filebeat.check_wait(exit_code=1)