diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 509115e037ec..15640651e62a 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -23,6 +23,9 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d leaf field `user.group` is now the `group` field set. {pull}10275[10275] - Update the code of Central Management to align with the new returned format. {pull}10019[10019] - Docker and Kubernetes labels/annotations will be "dedoted" by default. {pull}10338[10338] +- Remove --setup command line flag. {pull}10138[10138] +- Remove --version command line flag. {pull}10138[10138] +- Remove --configtest command line flag. {pull}10138[10138] *Auditbeat* diff --git a/auditbeat/auditbeat.yml b/auditbeat/auditbeat.yml index 3522827d7a9f..0004039a77c6 100644 --- a/auditbeat/auditbeat.yml +++ b/auditbeat/auditbeat.yml @@ -73,7 +73,7 @@ setup.template.settings: #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL diff --git a/filebeat/filebeat.yml b/filebeat/filebeat.yml index 2664206c560b..6585d1e49a89 100644 --- a/filebeat/filebeat.yml +++ b/filebeat/filebeat.yml @@ -101,7 +101,7 @@ setup.template.settings: #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL diff --git a/filebeat/tests/system/test_ml.py b/filebeat/tests/system/test_ml.py index d6f69356662b..aa84b92a0fad 100644 --- a/filebeat/tests/system/test_ml.py +++ b/filebeat/tests/system/test_ml.py @@ -31,21 +31,19 @@ def init(self): self.index_name = "test-filebeat-ml" @parameterized.expand([ - (True, False), - (True, True), - (False, False), - (False, True), + (False,), + (True,), ]) @unittest.skipIf(not INTEGRATION_TESTS, "integration tests are disabled, run with INTEGRATION_TESTS=1 to enable them.") @unittest.skipIf(os.getenv("TESTING_ENVIRONMENT") == "2x", "integration test not available on 2.x") @unittest.skipIf(os.name == "nt", "skipped on Windows") - def test_ml_setup(self, setup_flag, modules_flag): + def test_ml_setup(self, modules_flag): """ Test ML are installed in all possible ways """ - self._run_ml_test(setup_flag, modules_flag) + self._run_ml_test(modules_flag) - def _run_ml_test(self, setup_flag, modules_flag): + def _run_ml_test(self, modules_flag): self.init() from elasticsearch import AuthorizationException @@ -55,7 +53,7 @@ def _run_ml_test(self, setup_flag, modules_flag): except AuthorizationException: print("License already enabled") - print("Test setup_flag: {}, modules_flag: {}".format(setup_flag, modules_flag)) + print("Test modules_flag: {}".format(modules_flag)) # Clean any previous state for df in self.es.transport.perform_request("GET", "/_xpack/ml/datafeeds/")["datafeeds"]: @@ -93,14 +91,9 @@ def _run_ml_test(self, setup_flag, modules_flag): "-c", cfgfile ] - # Skipping dashboard loading to speed up tests, unfortunately only works for setup and not --setup + # Skipping dashboard loading to speed up tests cmd += ["-E", "setup.dashboards.enabled=false"] - - if setup_flag: - cmd += ["--setup"] - else: - cmd += ["setup", "--machine-learning"] - + cmd += ["setup", "--machine-learning"] if modules_flag: cmd += ["--modules=nginx"] diff --git a/heartbeat/heartbeat.yml b/heartbeat/heartbeat.yml index 9f607e4a8409..6e1d31515e70 100644 --- a/heartbeat/heartbeat.yml +++ b/heartbeat/heartbeat.yml @@ -58,7 +58,7 @@ setup.template.settings: #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL diff --git a/journalbeat/journalbeat.yml b/journalbeat/journalbeat.yml index ed12b9d15513..06326ece0819 100644 --- a/journalbeat/journalbeat.yml +++ b/journalbeat/journalbeat.yml @@ -64,7 +64,7 @@ journalbeat.inputs: #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL diff --git a/libbeat/_meta/config.yml b/libbeat/_meta/config.yml index af767564d8b0..c038793ef682 100644 --- a/libbeat/_meta/config.yml +++ b/libbeat/_meta/config.yml @@ -18,7 +18,7 @@ #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL diff --git a/libbeat/cfgfile/cfgfile.go b/libbeat/cfgfile/cfgfile.go index f2ff9ca1653b..a973ffccfedb 100644 --- a/libbeat/cfgfile/cfgfile.go +++ b/libbeat/cfgfile/cfgfile.go @@ -18,7 +18,6 @@ package cfgfile import ( - "flag" "fmt" "os" "path/filepath" @@ -34,7 +33,6 @@ var ( // be called prior to flags.Parse(). configfiles = common.StringArrFlag(nil, "c", "beat.yml", "Configuration file, relative to path.config") overwrites = common.SettingFlag(nil, "E", "Configuration overwrite") - testConfig = flag.Bool("configtest", false, "Test configuration and exit.") // Additional default settings, that must be available for variable expansion defaults = common.MustNewConfigFrom(map[string]interface{}{ @@ -199,8 +197,3 @@ func GetPathConfig() string { // TODO: Do we need this or should we always return *homePath? return "" } - -// IsTestConfig returns whether or not this is configuration used for testing -func IsTestConfig() bool { - return *testConfig -} diff --git a/libbeat/cmd/instance/beat.go b/libbeat/cmd/instance/beat.go index 3e0465d5eb6f..2ab590dc900f 100644 --- a/libbeat/cmd/instance/beat.go +++ b/libbeat/cmd/instance/beat.go @@ -111,18 +111,10 @@ type beatConfig struct { ILM *common.Config `config:"output.elasticsearch.ilm"` } -var ( - printVersion bool - setup bool -) - var debugf = logp.MakeDebug("beat") func init() { initRand() - - flag.BoolVar(&printVersion, "version", false, "Print the version and exit") - flag.BoolVar(&setup, "setup", false, "Load sample Kibana dashboards and setup Machine Learning") } // initRand initializes the runtime random number generator seed using @@ -381,13 +373,6 @@ func (b *Beat) launch(settings Settings, bt beat.Creator) error { defer reporter.Stop() } - // If -configtest was specified, exit now prior to run. - if cfgfile.IsTestConfig() { - cfgwarn.Deprecate("6.0", "-configtest flag has been deprecated, use configtest subcommand") - fmt.Println("Config OK") - return beat.GracefulExit - } - ctx, cancel := context.WithCancel(context.Background()) svc.HandleSignals(beater.Stop, cancel) @@ -395,12 +380,6 @@ func (b *Beat) launch(settings Settings, bt beat.Creator) error { if err != nil { return err } - if setup && b.SetupMLCallback != nil { - err = b.SetupMLCallback(&b.Beat, b.Config.Kibana) - if err != nil { - return err - } - } logp.Info("%s start running.", b.Info.Beat) @@ -548,18 +527,10 @@ func (b *Beat) Setup(bt beat.Creator, settings SetupSettings) error { }()) } -// handleFlags parses the command line flags. It handles the '-version' flag -// and invokes the HandleFlags callback if implemented by the Beat. +// handleFlags parses the command line flags. It invokes the HandleFlags +// callback if implemented by the Beat. func (b *Beat) handleFlags() error { flag.Parse() - - if printVersion { - cfgwarn.Deprecate("6.0", "-version flag has been deprecated, use version subcommand") - fmt.Printf("%s version %s (%s), libbeat %s\n", - b.Info.Beat, b.Info.Version, runtime.GOARCH, version.GetDefaultVersion()) - return beat.GracefulExit - } - return cfgfile.HandleFlags() } @@ -722,8 +693,8 @@ func openRegular(filename string) (*os.File, error) { } func (b *Beat) loadDashboards(ctx context.Context, force bool) error { - if setup || force { - // -setup implies dashboards.enabled=true + if force { + // force implies dashboards.enabled=true if b.Config.Dashboards == nil { b.Config.Dashboards = common.NewConfig() } diff --git a/libbeat/cmd/run.go b/libbeat/cmd/run.go index 944b18e3cb5d..4ebab4c6f7af 100644 --- a/libbeat/cmd/run.go +++ b/libbeat/cmd/run.go @@ -46,14 +46,6 @@ func genRunCmd(settings instance.Settings, beatCreator beat.Creator, runFlags *p runCmd.Flags().AddGoFlag(flag.CommandLine.Lookup("httpprof")) runCmd.Flags().AddGoFlag(flag.CommandLine.Lookup("cpuprofile")) runCmd.Flags().AddGoFlag(flag.CommandLine.Lookup("memprofile")) - runCmd.Flags().AddGoFlag(flag.CommandLine.Lookup("setup")) - - // TODO deprecate in favor of subcommands (7.0): - runCmd.Flags().AddGoFlag(flag.CommandLine.Lookup("configtest")) - runCmd.Flags().AddGoFlag(flag.CommandLine.Lookup("version")) - - runCmd.Flags().MarkDeprecated("version", "use version subcommand") - runCmd.Flags().MarkDeprecated("configtest", "use test config subcommand") if runFlags != nil { runCmd.Flags().AddFlagSet(runFlags) diff --git a/libbeat/docs/command-reference.asciidoc b/libbeat/docs/command-reference.asciidoc index 014c321caf7e..95291cab9e05 100644 --- a/libbeat/docs/command-reference.asciidoc +++ b/libbeat/docs/command-reference.asciidoc @@ -523,21 +523,6 @@ the end of the file is reached. By default harvesters are closed after `close_inactive` is reached. endif::[] -*`--setup`*:: -ifdef::deprecate_dashboard_loading[] -deprecated[{deprecate_dashboard_loading}] -endif::[] -+ -ifdef::has_ml_jobs[] -Loads the initial setup, including Elasticsearch template, {kib} index pattern, -{kib} dashboards (when available), and Machine learning jobs. -endif::[] -ifndef::has_ml_jobs[] -Loads the initial setup, including Elasticsearch template, {kib} index pattern, and {kib} dashboards (when available). -endif::[] -If you want to use the command without running {beatname_uc}, use the <> command instead. - - ifeval::["{beatname_lc}"=="metricbeat"] *`--system.hostfs MOUNT_POINT`*:: @@ -558,14 +543,14 @@ endif::[] ["source","sh",subs="attributes"] ----- -{beatname_lc} run -e --setup +{beatname_lc} run -e ----- Or: ["source","sh",subs="attributes"] ----- -{beatname_lc} -e --setup +{beatname_lc} -e ----- [[setup-command]] @@ -583,8 +568,8 @@ ifdef::has_ml_jobs[] necessary to analyze data for anomalies. endif::[] -Use this command instead of `run --setup` when you want to set up the -environment without actually running {beatname_uc} and ingesting data. +Use this command if you want to set up the environment without actually running +{beatname_uc} and ingesting data. *SYNOPSIS* diff --git a/libbeat/tests/system/beat/beat.py b/libbeat/tests/system/beat/beat.py index 7e114f2def2b..fa88fb1aba32 100644 --- a/libbeat/tests/system/beat/beat.py +++ b/libbeat/tests/system/beat/beat.py @@ -221,6 +221,8 @@ def start_beat(self, def render_config_template(self, template_name=None, output=None, **kargs): + print("render config") + # Init defaults if template_name is None: template_name = self.beat_name diff --git a/libbeat/tests/system/test_base.py b/libbeat/tests/system/test_base.py index a20ae6d1d619..a08af980e9f0 100644 --- a/libbeat/tests/system/test_base.py +++ b/libbeat/tests/system/test_base.py @@ -65,25 +65,6 @@ def test_invalid_config_cli_param(self): assert exit_code == 1 assert self.log_contains("error unpacking config data") is True - def test_config_test(self): - """ - Checks if -configtest works as expected - """ - shutil.copy(self.beat_path + "/_meta/config.yml", - os.path.join(self.working_dir, "libbeat.yml")) - with open(self.working_dir + "/mockbeat.template.json", "w") as f: - f.write('{"template": true}') - with open(self.working_dir + "/mockbeat.template-es2x.json", "w") as f: - f.write('{"template": true}') - - exit_code = self.run_beat( - config="libbeat.yml", - extra_args=["-configtest", - "-path.config", self.working_dir]) - - assert exit_code == 0 - assert self.log_contains("Config OK") is True - # NOTE(ph): I've removed the code to crash with theses settings, but the test is still usefull if # more settings are added. # def test_invalid_config_with_removed_settings(self): @@ -101,45 +82,6 @@ def test_config_test(self): # assert self.log_contains("setting 'queue_size' has been removed") # assert self.log_contains("setting 'bulk_queue_size' has been removed") - def test_version_simple(self): - """ - Tests -version prints a version and exits. - """ - self.start_beat(extra_args=["-version"]).check_wait() - assert self.log_contains("beat version") is True - - def test_version(self): - """ - Checks if version param works - """ - args = [self.beat_path + "/libbeat.test"] - - args.extend(["-version", - "-e", - "-systemTest", - "-v", - "-d", "*", - ]) - if os.getenv("TEST_COVERAGE") == "true": - args.extend([ - "-test.coverprofile", - os.path.join(self.working_dir, "coverage.cov"), - ]) - - assert self.log_contains("error loading config file") is False - - with open(os.path.join(self.working_dir, "mockbeat.log"), "wb") \ - as outputfile: - proc = subprocess.Popen(args, - stdout=outputfile, - stderr=subprocess.STDOUT) - exit_code = proc.wait() - assert exit_code == 0 - - assert self.log_contains("mockbeat") is True - assert self.log_contains("version") is True - assert self.log_contains("9.9.9") is True - def test_console_output_timed_flush(self): """ outputs/console - timed flush diff --git a/libbeat/tests/system/test_cmd.py b/libbeat/tests/system/test_cmd.py index c657a3cad3cd..e29af7301db5 100644 --- a/libbeat/tests/system/test_cmd.py +++ b/libbeat/tests/system/test_cmd.py @@ -67,41 +67,6 @@ def test_setup_template(self): assert exit_code == 0 assert len(self.es.cat.templates(name='mockbeat-*', h='name')) > 0 - @unittest.skipUnless(INTEGRATION_TESTS, "integration test") - @attr('integration') - def test_setup_flag(self): - """ - Test --setup flag on run command - """ - # Delete any existing template - try: - self.es.indices.delete_template('mockbeat-*') - except: - pass - - assert len(self.es.cat.templates(name='mockbeat-*', h='name')) == 0 - - shutil.copy(self.beat_path + "/_meta/config.yml", - os.path.join(self.working_dir, "libbeat.yml")) - shutil.copy(self.beat_path + "/fields.yml", - os.path.join(self.working_dir, "fields.yml")) - - proc = self.start_beat( - extra_args=["--setup", - "--path.config", self.working_dir, - "-E", "setup.dashboards.file=" + - os.path.join(self.beat_path, "tests", "files", "testbeat-dashboards.zip"), - "-E", "setup.dashboards.beat=testbeat", - "-E", "setup.kibana.protocol=http", - "-E", "setup.kibana.host=" + self.get_kibana_host(), - "-E", "setup.kibana.port=" + self.get_kibana_port(), - "-E", "output.elasticsearch.hosts=['" + self.get_host() + "']"], - config="libbeat.yml") - - self.wait_until(lambda: self.es.cat.templates(name='mockbeat-*', h='name') > 0) - self.wait_until(lambda: self.log_contains("Kibana dashboards successfully loaded")) - proc.check_kill_and_wait() - @unittest.skipUnless(INTEGRATION_TESTS, "integration test") @attr('integration') def test_test_config(self): diff --git a/metricbeat/metricbeat.yml b/metricbeat/metricbeat.yml index 9732d9907b1c..b669f2f7fba1 100644 --- a/metricbeat/metricbeat.yml +++ b/metricbeat/metricbeat.yml @@ -45,7 +45,7 @@ setup.template.settings: #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL diff --git a/packetbeat/packetbeat.yml b/packetbeat/packetbeat.yml index 0c207a4d1991..ffc36d4beab7 100644 --- a/packetbeat/packetbeat.yml +++ b/packetbeat/packetbeat.yml @@ -127,7 +127,7 @@ setup.template.settings: #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL diff --git a/packetbeat/tests/system/test_0026_test_config.py b/packetbeat/tests/system/test_0026_test_config.py index 81011b741622..d9ea29a89aa9 100644 --- a/packetbeat/tests/system/test_0026_test_config.py +++ b/packetbeat/tests/system/test_0026_test_config.py @@ -1,5 +1,7 @@ from packetbeat import BaseTest import os +import unittest +import subprocess """ Tests for checking the -configtest CLI option and the @@ -9,24 +11,63 @@ class Test(BaseTest): + @unittest.skipIf(os.name != 'linux', "default device 'any' only exists on linux") def test_ok_config(self): """ - With -configtest and correct configuration, it should exit with + With 'test config' and correct configuration, it should exit with status 0 but not actually process any packets. """ + + print("start test") + self.render_config_template() - self.run_packetbeat(pcap="http_post.pcap", - extra_args=["-configtest"]) + self.run_pb_config_tst() assert not os.path.isfile( os.path.join(self.working_dir, "output/packetbeat")) def test_config_error(self): """ - With -configtest and an error in the configuration, it should + With 'test config' and an error in the configuration, it should return a non-zero error code. """ self.render_config_template( bpf_filter="invalid BPF filter" ) - self.start_packetbeat(extra_args=["-configtest"]).check_wait(exit_code=1) + + self.run_pb_config_tst(exit_code=1) + + def run_pb_config_tst(self, exit_code=0): + config = "packetbeat.yml" + + cmd = os.path.join(self.beat_path, "packetbeat.test") + args = [ + cmd, "-systemTest", + "-c", os.path.join(self.working_dir, config), + ] + + if os.getenv("TEST_COVERAGE") == "true": + args += [ + "-test.coverprofile", + os.path.join(self.working_dir, "coverage.cov"), + ] + + args.extend(["test", "config"]) + + output = "packetbeat.log" + + with open(os.path.join(self.working_dir, output), "wb") as outfile: + proc = subprocess.Popen(args, + stdout=outfile, + stderr=subprocess.STDOUT + ) + actual_exit_code = proc.wait() + + if actual_exit_code != exit_code: + print("============ Log Output =====================") + with open(os.path.join(self.working_dir, output)) as f: + print(f.read()) + print("============ Log End Output =====================") + assert actual_exit_code == exit_code, "Expected exit code to be %d, but it was %d" % ( + exit_code, actual_exit_code) + return actual_exit_code diff --git a/winlogbeat/tests/system/test_config.py b/winlogbeat/tests/system/test_config.py index 13b51694cd6b..16862bf44f97 100644 --- a/winlogbeat/tests/system/test_config.py +++ b/winlogbeat/tests/system/test_config.py @@ -1,3 +1,5 @@ +import os +import subprocess import sys import unittest from winlogbeat import BaseTest @@ -20,7 +22,7 @@ def test_valid_config(self): {"name": "Application", "ignore_older": "48h"} ] ) - self.start_beat(extra_args=["-configtest"]).check_wait() + self.run_config_tst(exit_code=0) def test_invalid_ignore_older(self): """ @@ -31,7 +33,7 @@ def test_invalid_ignore_older(self): {"name": "Application", "ignore_older": "1 hour"} ] ) - self.start_beat(extra_args=["-configtest"]).check_wait(exit_code=1) + self.run_config_tst(exit_code=1) assert self.log_contains( "unknown unit hour in duration 1 hour " "accessing 'winlogbeat.event_logs.0.ignore_older'") @@ -45,7 +47,7 @@ def test_invalid_level(self): {"name": "Application", "level": "errors"} ] ) - self.start_beat(extra_args=["-configtest"]).check_wait(exit_code=1) + self.run_config_tst(exit_code=1) assert self.log_contains( "invalid level ('errors') for query") @@ -58,6 +60,41 @@ def test_invalid_api(self): {"name": "Application", "api": "file"} ] ) - self.start_beat(extra_args=["-configtest"]).check_wait(exit_code=1) + self.run_config_tst(exit_code=1) assert self.log_contains("Failed to create new event log. " "file API is not available") + + def run_config_tst(self, pcap=None, exit_code=0): + config = "winlogbeat.yml" + + cmd = os.path.join(self.beat_path, "winlogbeat.test") + args = [ + cmd, "-systemTest", + "-c", os.path.join(self.working_dir, config), + ] + + if os.getenv("TEST_COVERAGE") == "true": + args += [ + "-test.coverprofile", + os.path.join(self.working_dir, "coverage.cov"), + ] + + args.extend(["test", "config"]) + + output = "winlogbeat.log" + + with open(os.path.join(self.working_dir, output), "wb") as outfile: + proc = subprocess.Popen(args, + stdout=outfile, + stderr=subprocess.STDOUT + ) + actual_exit_code = proc.wait() + + if actual_exit_code != exit_code: + print("============ Log Output =====================") + with open(os.path.join(self.working_dir, output)) as f: + print(f.read()) + print("============ Log End Output =====================") + assert actual_exit_code == exit_code, "Expected exit code to be %d, but it was %d" % ( + exit_code, actual_exit_code) + return actual_exit_code diff --git a/winlogbeat/tests/system/test_eventlogging.py b/winlogbeat/tests/system/test_eventlogging.py index adfbef280782..2cc635bdc4e8 100644 --- a/winlogbeat/tests/system/test_eventlogging.py +++ b/winlogbeat/tests/system/test_eventlogging.py @@ -169,7 +169,7 @@ def test_unknown_eventlog_config(self): } ] ) - self.start_beat(extra_args=["-configtest"]).check_wait(exit_code=1) + self.start_beat().check_wait(exit_code=1) assert self.log_contains("4 errors: Invalid event log key") def test_utf16_characters(self): diff --git a/winlogbeat/tests/system/test_wineventlog.py b/winlogbeat/tests/system/test_wineventlog.py index 757bdbc7e18f..fc71c9d1693d 100644 --- a/winlogbeat/tests/system/test_wineventlog.py +++ b/winlogbeat/tests/system/test_wineventlog.py @@ -170,7 +170,8 @@ def test_include_xml(self): self.assertTrue(len(evts), 1) self.assert_common_fields(evts[0], msg=msg) self.assertTrue("xml" in evts[0]) - self.assertTrue(evts[0]["xml"].endswith(''), 'xml value: "{}"'.format(evts[0]["xml"])) + self.assertTrue(evts[0]["xml"].endswith(''), + 'xml value: "{}"'.format(evts[0]["xml"])) def test_query_event_id(self): """ @@ -205,8 +206,10 @@ def test_query_level_single(self): """ self.write_event_log("success", level=win32evtlog.EVENTLOG_SUCCESS) self.write_event_log("error", level=win32evtlog.EVENTLOG_ERROR_TYPE) - self.write_event_log("warning", level=win32evtlog.EVENTLOG_WARNING_TYPE) - self.write_event_log("information", level=win32evtlog.EVENTLOG_INFORMATION_TYPE) + self.write_event_log( + "warning", level=win32evtlog.EVENTLOG_WARNING_TYPE) + self.write_event_log( + "information", level=win32evtlog.EVENTLOG_INFORMATION_TYPE) evts = self.read_events(config={ "event_logs": [ { @@ -223,10 +226,14 @@ def test_query_level_multiple(self): """ wineventlog - Query by level (error, warning) """ - self.write_event_log("success", level=win32evtlog.EVENTLOG_SUCCESS) # Level 0, Info - self.write_event_log("error", level=win32evtlog.EVENTLOG_ERROR_TYPE) # Level 2 - self.write_event_log("warning", level=win32evtlog.EVENTLOG_WARNING_TYPE) # Level 3 - self.write_event_log("information", level=win32evtlog.EVENTLOG_INFORMATION_TYPE) # Level 4 + self.write_event_log( + "success", level=win32evtlog.EVENTLOG_SUCCESS) # Level 0, Info + self.write_event_log( + "error", level=win32evtlog.EVENTLOG_ERROR_TYPE) # Level 2 + self.write_event_log( + "warning", level=win32evtlog.EVENTLOG_WARNING_TYPE) # Level 3 + self.write_event_log( + "information", level=win32evtlog.EVENTLOG_INFORMATION_TYPE) # Level 4 evts = self.read_events(config={ "event_logs": [ { @@ -284,7 +291,8 @@ def test_query_multi_param(self): self.write_event_log("selected", source=self.otherAppName, eventID=556, level=win32evtlog.EVENTLOG_ERROR_TYPE) self.write_event_log("filtered", source=self.otherAppName, eventID=556) - self.write_event_log("filtered", level=win32evtlog.EVENTLOG_WARNING_TYPE) + self.write_event_log( + "filtered", level=win32evtlog.EVENTLOG_WARNING_TYPE) evts = self.read_events(config={ "event_logs": [ { @@ -312,8 +320,9 @@ def test_unknown_eventlog_config(self): "invalid": "garbage"} ] ) - self.start_beat(extra_args=["-configtest"]).check_wait(exit_code=1) - assert self.log_contains("1 error: Invalid event log key 'invalid' found.") + self.start_beat().check_wait(exit_code=1) + assert self.log_contains( + "1 error: Invalid event log key 'invalid' found.") def test_utf16_characters(self): """ diff --git a/winlogbeat/winlogbeat.yml b/winlogbeat/winlogbeat.yml index f310887207c8..d8fc5fd1b178 100644 --- a/winlogbeat/winlogbeat.yml +++ b/winlogbeat/winlogbeat.yml @@ -49,7 +49,7 @@ setup.template.settings: #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL diff --git a/x-pack/auditbeat/auditbeat.yml b/x-pack/auditbeat/auditbeat.yml index 7b0ca2d075e5..b52dc649e7e1 100644 --- a/x-pack/auditbeat/auditbeat.yml +++ b/x-pack/auditbeat/auditbeat.yml @@ -95,7 +95,7 @@ setup.template.settings: #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL diff --git a/x-pack/filebeat/filebeat.yml b/x-pack/filebeat/filebeat.yml index 2664206c560b..6585d1e49a89 100644 --- a/x-pack/filebeat/filebeat.yml +++ b/x-pack/filebeat/filebeat.yml @@ -101,7 +101,7 @@ setup.template.settings: #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL diff --git a/x-pack/functionbeat/functionbeat.yml b/x-pack/functionbeat/functionbeat.yml index 1136f2d26ba4..31c90a1d4af7 100644 --- a/x-pack/functionbeat/functionbeat.yml +++ b/x-pack/functionbeat/functionbeat.yml @@ -164,7 +164,7 @@ functionbeat.provider.aws.functions: #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL diff --git a/x-pack/metricbeat/metricbeat.yml b/x-pack/metricbeat/metricbeat.yml index 9732d9907b1c..b669f2f7fba1 100644 --- a/x-pack/metricbeat/metricbeat.yml +++ b/x-pack/metricbeat/metricbeat.yml @@ -45,7 +45,7 @@ setup.template.settings: #============================== Dashboards ===================================== # These settings control loading the sample dashboards to the Kibana index. Loading # the dashboards is disabled by default and can be enabled either by setting the -# options here, or by using the `-setup` CLI flag or the `setup` command. +# options here or by using the `setup` command. #setup.dashboards.enabled: false # The URL from where to download the dashboards archive. By default this URL