Skip to content

Commit

Permalink
use knownKeys to check field aws.*.metrics.*.*
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiyan-sheng committed Apr 7, 2021
1 parent 956625f commit e68e4df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions metricbeat/mb/testing/testdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,10 @@ func documentedFieldCheck(foundKeys common.MapStr, knownKeys map[string]interfac
}

// case `aws.*.metrics.*.*`:
if splits[0] == "aws" && splits[2] == "metrics" && len(splits) == 5 {
continue
if len(splits) == 5 {
if _, ok := knownKeys[splits[0]+".*"+splits[2]+".*.*"]; ok {
continue
}
}

return errors.Errorf("field missing '%s'", foundKey)
Expand Down

0 comments on commit e68e4df

Please sign in to comment.