Skip to content

Commit

Permalink
code review change - fix typo
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 10, 2024
1 parent e280d23 commit e8f2ef9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions x-pack/filebeat/input/awscloudwatch/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (in *cloudwatchInput) Run(inputContext v2.Context, pipeline beat.Pipeline)
// fromConfig is a helper to parse input configurations and derive logGroupIDs & aws region
// Returned logGroupIDs could be empty, which require other fallback mechanisms to derive them.
// See getLogGroupNames for example.
func fromConfig(cfg config, awsCfg awssdk.Config) (logGrouIDs []string, region string, err error) {
func fromConfig(cfg config, awsCfg awssdk.Config) (logGroupIDs []string, region string, err error) {
// LogGroupARN has precedence over LogGroupName & RegionName
if cfg.LogGroupARN != "" {
parsedArn, err := arn.Parse(cfg.LogGroupARN)
Expand All @@ -144,14 +144,14 @@ func fromConfig(cfg config, awsCfg awssdk.Config) (logGrouIDs []string, region s

// refine to match AWS API parameter regex of logGroupIdentifier
groupId := strings.TrimSuffix(cfg.LogGroupARN, ":*")
logGrouIDs = append(logGrouIDs, groupId)
logGroupIDs = append(logGroupIDs, groupId)

return logGrouIDs, parsedArn.Region, nil
return logGroupIDs, parsedArn.Region, nil
}

// then fallback to LogrGroupName
if cfg.LogGroupName != "" {
logGrouIDs = append(logGrouIDs, cfg.LogGroupName)
logGroupIDs = append(logGroupIDs, cfg.LogGroupName)
}

// finally derive region
Expand All @@ -161,7 +161,7 @@ func fromConfig(cfg config, awsCfg awssdk.Config) (logGrouIDs []string, region s
region = awsCfg.Region
}

return logGrouIDs, region, nil
return logGroupIDs, region, nil
}

// getLogGroupNames uses DescribeLogGroups API to retrieve all log group names
Expand Down

0 comments on commit e8f2ef9

Please sign in to comment.