fix(inputs.cloudwatch): Ensure account list is larger than index (#15428)
This commit is contained in:
parent
58aae6201b
commit
042b257b64
|
|
@ -378,7 +378,7 @@ func (c *CloudWatch) getDataQueries(filteredMetrics []filteredMetric) map[string
|
||||||
id := strconv.Itoa(j) + "_" + strconv.Itoa(i)
|
id := strconv.Itoa(j) + "_" + strconv.Itoa(i)
|
||||||
dimension := ctod(metric.Dimensions)
|
dimension := ctod(metric.Dimensions)
|
||||||
var accountID *string
|
var accountID *string
|
||||||
if c.IncludeLinkedAccounts {
|
if c.IncludeLinkedAccounts && len(filtered.accounts) > j {
|
||||||
accountID = aws.String(filtered.accounts[j])
|
accountID = aws.String(filtered.accounts[j])
|
||||||
(*dimension)["account"] = filtered.accounts[j]
|
(*dimension)["account"] = filtered.accounts[j]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue