diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index df9e7acea81..edd32bcca81 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 381b3c04b3d..62412f67731 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 65abdbfda3e..82eb5c3919c 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 c99d05c9554..a660eb366b8 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 c06827965ff..f021664f4a2 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 c4137f6c7f7..80394e0a34e 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 69c0d43d20a..cc3189f02c8 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 2914a427fbd..a7c7be6677f 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 150750d4a38..b8d5d428e2d 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 f72f40318a5..f9ad8dab8d2 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 daa8b40e0e3..6e6df31c98d 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 88145350c82..6491383ac5c 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 9364f344a39..3af7faef7ac 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 c5756c0d5de..3e0f688ffcd 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 f24fbed6dee..0aafa20506f 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 520623a235d..40e647ea5dc 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 b2f7f38568e..6ee86354c3f 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 eddd6e9a96b..6f2399589bd 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 d34a25c95f4..14e6ae0ec35 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 52916c295de..ce6926f5736 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 146cdd064ac..be48ff074a4 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 1eb03dae601..30a3e7ebb0d 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 d7b75fe695d..02b9db547cf 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 b13c6253ff8..3e2f4b3f2e3 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 f0cbb3092ed..9030a4cc12f 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 25eb815890f..06409690e8a 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 bd5296e0c5f..b6b07bad222 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 dace07bf644..1d92c6bd61a 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 c06827965ff..f021664f4a2 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 7184c2f40ac..6aa338385a5 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 73ab5b1cca3..95051fd4386 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 37dff29caae..40bb1694cce 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 52916c295de..ce6926f5736 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