Skip to content

Commit

Permalink
x-pack/filebeat/input/cel: fix handling of infinite values in rates
Browse files Browse the repository at this point in the history
The protobuf.Value.AsInterface method encodes +Inf as "Infinity" so
ensure that we accept that string.
  • Loading branch information
efd6 committed Jun 19, 2024
1 parent 50ba112 commit 1ab2035
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Add support for base64-encoded HMAC headers to HTTP Endpoint. {pull}39655[39655]
- Add user group membership support to Okta entity analytics provider. {issue}39814[39814] {pull}39815[39815]
- Add request trace support for Okta and EntraID entity analytics providers. {pull}39821[39821]
- Fix handling of infinite rate values in CEL rate limit handling logic. {pull}[]

*Auditbeat*

Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/input/cel/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ func getLimit(which string, rateLimit map[string]interface{}, log *logp.Logger)
case float64:
limit = rate.Limit(r)
case string:
if !strings.EqualFold(r, "inf") {
if !strings.EqualFold(strings.TrimPrefix(r, "+"), "inf") && !strings.EqualFold(strings.TrimPrefix(r, "+"), "infinity") {
log.Errorw("unexpected value returned for rate limit "+which, "value", r, "rate_limit", mapstr.M(rateLimit))
return limit, false
}
Expand Down

0 comments on commit 1ab2035

Please sign in to comment.