diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 4100e2350915..f6ee719390df 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -33,6 +33,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add `cleanup_timeout` option to docker autodiscover, to wait some time before removing configurations after a container is stopped. {issue]10374[10374] {pull}10905[10905] - On Google Cloud Engine (GCE) the add_cloud_metadata will now trim the project info from the cloud.machine.type and cloud.availability_zone. {issue}10968[10968] +- Rename `migration.enabled` config to `migration.6_to_7.enabled`. {pull}11284[11284] *Auditbeat* diff --git a/auditbeat/auditbeat.reference.yml b/auditbeat/auditbeat.reference.yml index 381b3c04b3dc..62412f677317 100644 --- a/auditbeat/auditbeat.reference.yml +++ b/auditbeat/auditbeat.reference.yml @@ -1266,5 +1266,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/auditbeat/auditbeat.yml b/auditbeat/auditbeat.yml index 65abdbfda3e7..82eb5c3919c0 100644 --- a/auditbeat/auditbeat.yml +++ b/auditbeat/auditbeat.yml @@ -177,5 +177,5 @@ processors: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/filebeat/filebeat.reference.yml b/filebeat/filebeat.reference.yml index c99d05c95548..a660eb366b82 100644 --- a/filebeat/filebeat.reference.yml +++ b/filebeat/filebeat.reference.yml @@ -1977,5 +1977,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/filebeat/filebeat.yml b/filebeat/filebeat.yml index c06827965ffd..f021664f4a2a 100644 --- a/filebeat/filebeat.yml +++ b/filebeat/filebeat.yml @@ -205,5 +205,5 @@ processors: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/filebeat/tests/system/test_base.py b/filebeat/tests/system/test_base.py index c4137f6c7f79..80394e0a34e8 100644 --- a/filebeat/tests/system/test_base.py +++ b/filebeat/tests/system/test_base.py @@ -51,7 +51,7 @@ def test_template_migration(self): elasticsearch={"host": self.get_elasticsearch_url()}, ) exit_code = self.run_beat(extra_args=["setup", "--template", - "-E", "setup.template.overwrite=true", "-E", "migration.enabled=true"]) + "-E", "setup.template.overwrite=true", "-E", "migration.6_to_7.enabled=true"]) assert exit_code == 0 assert self.log_contains('Loaded index template') diff --git a/filebeat/tests/system/test_index_pattern.py b/filebeat/tests/system/test_index_pattern.py index 69c0d43d20a5..cc3189f02c8b 100644 --- a/filebeat/tests/system/test_index_pattern.py +++ b/filebeat/tests/system/test_index_pattern.py @@ -25,7 +25,7 @@ def test_export_index_pattern_migration(self): self.render_config_template() exit_code = self.run_beat( logging_args=[], - extra_args=["export", "index-pattern", "-E", "migration.enabled:true"]) + extra_args=["export", "index-pattern", "-E", "migration.6_to_7.enabled:true"]) assert exit_code == 0 assert self.log_contains('"objects": [') diff --git a/heartbeat/heartbeat.reference.yml b/heartbeat/heartbeat.reference.yml index 2914a427fbd7..a7c7be6677f4 100644 --- a/heartbeat/heartbeat.reference.yml +++ b/heartbeat/heartbeat.reference.yml @@ -1410,5 +1410,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/heartbeat/heartbeat.yml b/heartbeat/heartbeat.yml index 150750d4a385..b8d5d428e2d8 100644 --- a/heartbeat/heartbeat.yml +++ b/heartbeat/heartbeat.yml @@ -154,5 +154,5 @@ output.elasticsearch: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/journalbeat/journalbeat.reference.yml b/journalbeat/journalbeat.reference.yml index f72f40318a55..f9ad8dab8d29 100644 --- a/journalbeat/journalbeat.reference.yml +++ b/journalbeat/journalbeat.reference.yml @@ -1206,5 +1206,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/journalbeat/journalbeat.yml b/journalbeat/journalbeat.yml index daa8b40e0e33..6e6df31c98d8 100644 --- a/journalbeat/journalbeat.yml +++ b/journalbeat/journalbeat.yml @@ -174,5 +174,5 @@ processors: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/libbeat/_meta/config.reference.yml b/libbeat/_meta/config.reference.yml index 88145350c823..6491383ac5cb 100644 --- a/libbeat/_meta/config.reference.yml +++ b/libbeat/_meta/config.reference.yml @@ -1154,5 +1154,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/libbeat/_meta/config.yml b/libbeat/_meta/config.yml index 9364f344a393..3af7faef7ac1 100644 --- a/libbeat/_meta/config.yml +++ b/libbeat/_meta/config.yml @@ -122,5 +122,5 @@ processors: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/libbeat/cmd/export/index_pattern.go b/libbeat/cmd/export/index_pattern.go index c5756c0d5de9..3e0f688ffcd6 100644 --- a/libbeat/cmd/export/index_pattern.go +++ b/libbeat/cmd/export/index_pattern.go @@ -49,21 +49,12 @@ func GenIndexPatternConfigCmd(settings instance.Settings) *cobra.Command { version = b.Info.Version } - var withMigration bool - if b.RawConfig.HasField("migration") { - sub, err := b.RawConfig.Child("migration", -1) - if err != nil { - fatalf("Failed to read migration setting: %+v", err) - } - withMigration = sub.Enabled() - } - // Index pattern generation v, err := common.NewVersion(version) if err != nil { fatalf("Error creating version: %+v", err) } - indexPattern, err := kibana.NewGenerator(b.Info.IndexPrefix, b.Info.Beat, b.Fields, settings.Version, *v, withMigration) + indexPattern, err := kibana.NewGenerator(b.Info.IndexPrefix, b.Info.Beat, b.Fields, settings.Version, *v, b.Config.Migration.Enabled()) if err != nil { log.Fatal(err) } diff --git a/libbeat/cmd/export/template.go b/libbeat/cmd/export/template.go index f24fbed6dee8..0aafa20506f7 100644 --- a/libbeat/cmd/export/template.go +++ b/libbeat/cmd/export/template.go @@ -74,16 +74,7 @@ func GenTemplateConfigCmd(settings instance.Settings) *cobra.Command { tmplCfg = template.DefaultConfig() } - var withMigration bool - if b.RawConfig.HasField("migration") { - sub, err := b.RawConfig.Child("migration", -1) - if err != nil { - fatalf("Failed to read migration setting: %+v", err) - } - withMigration = sub.Enabled() - } - - tmpl, err := template.New(b.Info.Version, index, *esVersion, tmplCfg, withMigration) + tmpl, err := template.New(b.Info.Version, index, *esVersion, tmplCfg, b.Config.Migration.Enabled()) if err != nil { fatalf("Error generating template: %+v", err) } diff --git a/libbeat/cmd/instance/beat.go b/libbeat/cmd/instance/beat.go index 520623a235da..40e647ea5dc0 100644 --- a/libbeat/cmd/instance/beat.go +++ b/libbeat/cmd/instance/beat.go @@ -110,6 +110,9 @@ type beatConfig struct { // elastic stack 'setup' configurations Dashboards *common.Config `config:"setup.dashboards"` Kibana *common.Config `config:"setup.kibana"` + + // Migration config to migration from 6 to 7 + Migration *common.Config `config:"migration.6_to_7"` } var debugf = logp.MakeDebug("beat") @@ -694,14 +697,6 @@ func (b *Beat) loadDashboards(ctx context.Context, force bool) error { } if b.Config.Dashboards.Enabled() { - var withMigration bool - if b.RawConfig.HasField("migration") { - sub, err := b.RawConfig.Child("migration", -1) - if err != nil { - return fmt.Errorf("Failed to read migration setting: %+v", err) - } - withMigration = sub.Enabled() - } // Initialize kibana config. If username and password is set in elasticsearch output config but not in kibana, // initKibanaConfig will attach the ussername and password into kibana config as a part of the initialization. @@ -718,7 +713,7 @@ func (b *Beat) loadDashboards(ctx context.Context, force bool) error { // but it's assumed that KB and ES have the same minor version. v := client.GetVersion() - indexPattern, err := kibana.NewGenerator(b.Info.IndexPrefix, b.Info.Beat, b.Fields, b.Info.Version, v, withMigration) + indexPattern, err := kibana.NewGenerator(b.Info.IndexPrefix, b.Info.Beat, b.Fields, b.Info.Version, v, b.Config.Migration.Enabled()) if err != nil { return fmt.Errorf("error creating index pattern generator: %v", err) } diff --git a/libbeat/idxmgmt/idxmgmt.go b/libbeat/idxmgmt/idxmgmt.go index b2f7f38568e1..6ee86354c3fa 100644 --- a/libbeat/idxmgmt/idxmgmt.go +++ b/libbeat/idxmgmt/idxmgmt.go @@ -98,7 +98,7 @@ func MakeDefaultSupport(ilmSupport ilm.SupportFactory) SupportFactory { ILM *common.Config `config:"setup.ilm"` Template *common.Config `config:"setup.template"` Output common.ConfigNamespace `config:"output"` - Migration *common.Config `config:"migration"` + Migration *common.Config `config:"migration.6_to_7"` }{} if configRoot != nil { if err := configRoot.Unpack(&cfg); err != nil { diff --git a/libbeat/tests/system/test_migration.py b/libbeat/tests/system/test_migration.py index eddd6e9a96bb..6f2399589bd6 100644 --- a/libbeat/tests/system/test_migration.py +++ b/libbeat/tests/system/test_migration.py @@ -47,7 +47,7 @@ def test_migration_false(self): extra_args=[ "export", "template", "-E", "setup.template.fields=" + self.fields_path, - "-E", "migration.enabled=false", + "-E", "migration.6_to_7.enabled=false", ], config="libbeat.yml") @@ -64,7 +64,7 @@ def test_migration_true(self): extra_args=[ "export", "template", "-E", "setup.template.fields=" + self.fields_path, - "-E", "migration.enabled=true", + "-E", "migration.6_to_7.enabled=true", ], config="libbeat.yml") diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index d34a25c95f4a..14e6ae0ec35b 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -1874,5 +1874,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/metricbeat/metricbeat.yml b/metricbeat/metricbeat.yml index 52916c295ded..ce6926f57365 100644 --- a/metricbeat/metricbeat.yml +++ b/metricbeat/metricbeat.yml @@ -149,5 +149,5 @@ processors: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/metricbeat/tests/system/test_base.py b/metricbeat/tests/system/test_base.py index 146cdd064acb..be48ff074a46 100644 --- a/metricbeat/tests/system/test_base.py +++ b/metricbeat/tests/system/test_base.py @@ -92,7 +92,7 @@ def test_migration(self): elasticsearch={"host": self.get_elasticsearch_url()}, ) exit_code = self.run_beat(extra_args=["setup", "--template", - "-E", "setup.template.overwrite=true", "-E", "migration.enabled=true"]) + "-E", "setup.template.overwrite=true", "-E", "migration.6_to_7.enabled=true"]) assert exit_code == 0 assert self.log_contains('Loaded index template') diff --git a/packetbeat/packetbeat.reference.yml b/packetbeat/packetbeat.reference.yml index 1eb03dae6014..30a3e7ebb0de 100644 --- a/packetbeat/packetbeat.reference.yml +++ b/packetbeat/packetbeat.reference.yml @@ -1634,5 +1634,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/packetbeat/packetbeat.yml b/packetbeat/packetbeat.yml index d7b75fe695d7..02b9db547cf4 100644 --- a/packetbeat/packetbeat.yml +++ b/packetbeat/packetbeat.yml @@ -231,5 +231,5 @@ processors: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/winlogbeat/winlogbeat.reference.yml b/winlogbeat/winlogbeat.reference.yml index b13c6253ff8b..3e2f4b3f2e3c 100644 --- a/winlogbeat/winlogbeat.reference.yml +++ b/winlogbeat/winlogbeat.reference.yml @@ -1183,5 +1183,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/winlogbeat/winlogbeat.yml b/winlogbeat/winlogbeat.yml index f0cbb3092ed1..9030a4cc12f6 100644 --- a/winlogbeat/winlogbeat.yml +++ b/winlogbeat/winlogbeat.yml @@ -153,5 +153,5 @@ processors: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/x-pack/auditbeat/auditbeat.reference.yml b/x-pack/auditbeat/auditbeat.reference.yml index 25eb815890f0..06409690e8ab 100644 --- a/x-pack/auditbeat/auditbeat.reference.yml +++ b/x-pack/auditbeat/auditbeat.reference.yml @@ -1301,5 +1301,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/x-pack/auditbeat/auditbeat.yml b/x-pack/auditbeat/auditbeat.yml index bd5296e0c5f4..b6b07bad2229 100644 --- a/x-pack/auditbeat/auditbeat.yml +++ b/x-pack/auditbeat/auditbeat.yml @@ -199,5 +199,5 @@ processors: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/x-pack/filebeat/filebeat.reference.yml b/x-pack/filebeat/filebeat.reference.yml index dace07bf6448..1d92c6bd61ac 100644 --- a/x-pack/filebeat/filebeat.reference.yml +++ b/x-pack/filebeat/filebeat.reference.yml @@ -2056,5 +2056,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/x-pack/filebeat/filebeat.yml b/x-pack/filebeat/filebeat.yml index c06827965ffd..f021664f4a2a 100644 --- a/x-pack/filebeat/filebeat.yml +++ b/x-pack/filebeat/filebeat.yml @@ -205,5 +205,5 @@ processors: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/x-pack/functionbeat/functionbeat.reference.yml b/x-pack/functionbeat/functionbeat.reference.yml index 7184c2f40acc..6aa338385a5f 100644 --- a/x-pack/functionbeat/functionbeat.reference.yml +++ b/x-pack/functionbeat/functionbeat.reference.yml @@ -1299,5 +1299,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/x-pack/functionbeat/functionbeat.yml b/x-pack/functionbeat/functionbeat.yml index 73ab5b1cca33..95051fd43865 100644 --- a/x-pack/functionbeat/functionbeat.yml +++ b/x-pack/functionbeat/functionbeat.yml @@ -275,5 +275,5 @@ processors: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index 37dff29caae9..40bb1694cce6 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -1903,5 +1903,5 @@ logging.files: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false diff --git a/x-pack/metricbeat/metricbeat.yml b/x-pack/metricbeat/metricbeat.yml index 52916c295ded..ce6926f57365 100644 --- a/x-pack/metricbeat/metricbeat.yml +++ b/x-pack/metricbeat/metricbeat.yml @@ -149,5 +149,5 @@ processors: #================================= Migration ================================== -# This allows to enable migration aliases -#migration.enabled: false +# This allows to enable 6.7 migration aliases +#migration.6_to_7.enabled: false