Skip to content

Commit

Permalink
use non-pointer struct property
Browse files Browse the repository at this point in the history
Signed-off-by: Kavindu Dodanduwa <[email protected]>
  • Loading branch information
Kavindu-Dodan committed Oct 15, 2024
1 parent 4cd801e commit 7d37eb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion x-pack/filebeat/input/awscloudwatch/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
9 changes: 2 additions & 7 deletions x-pack/filebeat/input/awscloudwatch/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7d37eb8

Please sign in to comment.