From 5590c5c8ac4ba8a226dc04b1e4c37b61b67f9d36 Mon Sep 17 00:00:00 2001 From: michel-laterman Date: Tue, 7 Sep 2021 09:20:37 -0700 Subject: [PATCH] Change beat.Info.Name to beat.Info.Beat --- CHANGELOG.next.asciidoc | 2 +- libbeat/cmd/export/dashboard.go | 2 +- libbeat/cmd/instance/beat.go | 4 ++-- libbeat/dashboards/dashboards.go | 2 +- libbeat/monitoring/report/elasticsearch/elasticsearch.go | 2 +- libbeat/outputs/elasticsearch/elasticsearch.go | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 04efb39786c5..ed3bdf9ffd81 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -107,7 +107,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Bump AWS SDK version to v0.24.0 for WebIdentity authentication flow {issue}19393[19393] {pull}27126[27126] - Add Linux pressure metricset {pull}27355[27355] - Add support for kube-state-metrics v2.0.0 {pull}27552[27552] -- Add User-Agent header to HTTP requests. {issue}18160[18160] +- Add User-Agent header to HTTP requests. {issue}18160[18160] {pull}27509[27509] *Packetbeat* diff --git a/libbeat/cmd/export/dashboard.go b/libbeat/cmd/export/dashboard.go index fd26fdac5582..070afc251be4 100644 --- a/libbeat/cmd/export/dashboard.go +++ b/libbeat/cmd/export/dashboard.go @@ -58,7 +58,7 @@ func GenDashboardCmd(settings instance.Settings) *cobra.Command { // part of the initialization. initConfig := instance.InitKibanaConfig(b.Config) - client, err := kibana.NewKibanaClient(initConfig, b.Info.Name) + client, err := kibana.NewKibanaClient(initConfig, b.Info.Beat) if err != nil { fatalf("Error creating Kibana client: %+v.\n", err) } diff --git a/libbeat/cmd/instance/beat.go b/libbeat/cmd/instance/beat.go index 374222a6e773..00e5f89a1c9b 100644 --- a/libbeat/cmd/instance/beat.go +++ b/libbeat/cmd/instance/beat.go @@ -531,7 +531,7 @@ func (b *Beat) Setup(settings Settings, bt beat.Creator, setup SetupSettings) er if outCfg.Name() != "elasticsearch" { return fmt.Errorf("Index management requested but the Elasticsearch output is not configured/enabled") } - esClient, err := eslegclient.NewConnectedClient(outCfg.Config(), b.Info.Name) + esClient, err := eslegclient.NewConnectedClient(outCfg.Config(), b.Info.Beat) if err != nil { return err } @@ -808,7 +808,7 @@ func (b *Beat) loadDashboards(ctx context.Context, force bool) error { // initKibanaConfig will attach the username and password into kibana config as a part of the initialization. kibanaConfig := InitKibanaConfig(b.Config) - client, err := kibana.NewKibanaClient(kibanaConfig, b.Info.Name) + client, err := kibana.NewKibanaClient(kibanaConfig, b.Info.Beat) if err != nil { return fmt.Errorf("error connecting to Kibana: %v", err) } diff --git a/libbeat/dashboards/dashboards.go b/libbeat/dashboards/dashboards.go index 0e00bf047117..d1209235a543 100644 --- a/libbeat/dashboards/dashboards.go +++ b/libbeat/dashboards/dashboards.go @@ -54,7 +54,7 @@ func ImportDashboards( return errors.New("kibana configuration missing for loading dashboards") } - return setupAndImportDashboardsViaKibana(ctx, beatInfo.Hostname, beatInfo.Name, kibanaConfig, &dashConfig, msgOutputter, pattern) + return setupAndImportDashboardsViaKibana(ctx, beatInfo.Hostname, beatInfo.Beat, kibanaConfig, &dashConfig, msgOutputter, pattern) } func setupAndImportDashboardsViaKibana(ctx context.Context, hostname, beatname string, kibanaConfig *common.Config, diff --git a/libbeat/monitoring/report/elasticsearch/elasticsearch.go b/libbeat/monitoring/report/elasticsearch/elasticsearch.go index 5eb537989c90..96210c56c541 100644 --- a/libbeat/monitoring/report/elasticsearch/elasticsearch.go +++ b/libbeat/monitoring/report/elasticsearch/elasticsearch.go @@ -127,7 +127,7 @@ func makeReporter(beat beat.Info, settings report.Settings, cfg *common.Config) var clients []outputs.NetworkClient for _, host := range hosts { - client, err := makeClient(host, params, &config, beat.Name) + client, err := makeClient(host, params, &config, beat.Beat) if err != nil { return nil, err } diff --git a/libbeat/outputs/elasticsearch/elasticsearch.go b/libbeat/outputs/elasticsearch/elasticsearch.go index fffdbd68e290..8ed2b2cbb912 100644 --- a/libbeat/outputs/elasticsearch/elasticsearch.go +++ b/libbeat/outputs/elasticsearch/elasticsearch.go @@ -92,7 +92,7 @@ func makeES( client, err = NewClient(ClientSettings{ ConnectionSettings: eslegclient.ConnectionSettings{ URL: esURL, - Beatname: beat.Name, + Beatname: beat.Beat, Kerberos: config.Kerberos, Username: config.Username, Password: config.Password,