carbon-relay-ng
carbon-relay-ng copied to clipboard
incorrectly configured aggregation rules can result in "" keys
if you have an aggregation rule with an output format like $1foo
the expanded key is always "" , but ${1}foo
works. this is explained in https://golang.org/pkg/regexp/#Regexp.Expand
example: https://play.golang.org/p/VPM21sDOOWU
we should add config validation that people don't use letters right after a group number. we may also want to check if the group numbers are not too high, though not sure what's the best way to accomplish this.
likewise, we should also add similar checks elsewhere (e.g. rewriters)
this is causing messages to be constructed without key, so obviously bad output that will trigger validation errors in proper receivers (such as metrictank, which complains with metrictank_1 | 2019-04-26 15:44:55.386 [ERROR] carbon-in: invalid metric: packet must consist of 3 fields.
)