Skip to content

Commit

Permalink
[8.14](backport #39940) x-pack/filebeat/input/cel: fix handling of in…
Browse files Browse the repository at this point in the history
…finite values in rates (#39986)

* x-pack/filebeat/input/cel: fix handling of infinite values in rates (#39940)

The protobuf.Value.AsInterface method encodes +Inf as "Infinity" so
ensure that we accept that string.

(cherry picked from commit 1f8ad02)

* remove irrelevant changelog entry

---------

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
  • Loading branch information
mergify[bot] and efd6 authored Jun 20, 2024
1 parent 44aeabb commit 99a6e8c
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 @@ -140,6 +140,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Add setup option `--force-enable-module-filesets`, that will act as if all filesets have been enabled in a module during setup. {issue}30915[30915] {pull}99999[99999]
- Made Azure Blob Storage input GA and updated docs accordingly. {pull}37128[37128]
- Made GCS input GA and updated docs accordingly. {pull}37127[37127]
- Fix handling of infinite rate values in CEL rate limit handling logic. {pull}39940[39940]

*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 @@ -675,7 +675,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 99a6e8c

Please sign in to comment.