From 7d37eb8d57192f4f875d8a432657e8f77c3d0f16 Mon Sep 17 00:00:00 2001 From: Kavindu Dodanduwa Date: Tue, 15 Oct 2024 09:18:06 -0700 Subject: [PATCH] use non-pointer struct property Signed-off-by: Kavindu Dodanduwa --- x-pack/filebeat/input/awscloudwatch/config.go | 2 +- x-pack/filebeat/input/awscloudwatch/input.go | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/x-pack/filebeat/input/awscloudwatch/config.go b/x-pack/filebeat/input/awscloudwatch/config.go index bcadc8de5b3..5e826aa09fd 100644 --- a/x-pack/filebeat/input/awscloudwatch/config.go +++ b/x-pack/filebeat/input/awscloudwatch/config.go @@ -17,7 +17,7 @@ type config struct { LogGroupARN string `config:"log_group_arn"` LogGroupName string `config:"log_group_name"` LogGroupNamePrefix string `config:"log_group_name_prefix"` - IncludeLinkedAccountsForPrefixMode *bool `config:"include_linked_accounts_for_prefix_mode"` + IncludeLinkedAccountsForPrefixMode bool `config:"include_linked_accounts_for_prefix_mode"` RegionName string `config:"region_name"` LogStreams []*string `config:"log_streams"` LogStreamPrefix string `config:"log_stream_prefix"` diff --git a/x-pack/filebeat/input/awscloudwatch/input.go b/x-pack/filebeat/input/awscloudwatch/input.go index e1cd781e25d..27b1da04d1a 100644 --- a/x-pack/filebeat/input/awscloudwatch/input.go +++ b/x-pack/filebeat/input/awscloudwatch/input.go @@ -166,16 +166,11 @@ func fromConfig(cfg config, awsCfg awssdk.Config) (logGroupIDs []string, region } // getLogGroupNames uses DescribeLogGroups API to retrieve LogGroupArn entries that matches the provided logGroupNamePrefix -func getLogGroupNames(svc *cloudwatchlogs.Client, logGroupNamePrefix string, withLinkedAccount *bool) ([]string, error) { - var linkedAccounts bool - if withLinkedAccount != nil { - linkedAccounts = *withLinkedAccount - } - +func getLogGroupNames(svc *cloudwatchlogs.Client, logGroupNamePrefix string, withLinkedAccount bool) ([]string, error) { // construct DescribeLogGroupsInput describeLogGroupsInput := &cloudwatchlogs.DescribeLogGroupsInput{ LogGroupNamePrefix: awssdk.String(logGroupNamePrefix), - IncludeLinkedAccounts: awssdk.Bool(linkedAccounts), + IncludeLinkedAccounts: awssdk.Bool(withLinkedAccount), } // make API request