diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 9c6e506a9fc6..32f7e5078f36 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -165,6 +165,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Prevent panic in CEL and salesforce inputs when github.com/hashicorp/go-retryablehttp exceeds maximum retries. {pull}40144[40144] - Fix bug in CEL input rate limit logic. {issue}40106[40106] {pull}40270[40270] - Relax requirements in Okta entity analytics provider user and device profile data shape. {pull}40359[40359] +- Fix bug in Okta entity analytics rate limit logic. {issue}40106[40106] {pull}40267[40267] *Heartbeat* diff --git a/x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/okta.go b/x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/okta.go index 6703c82ed6f2..ef574ef4d26a 100644 --- a/x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/okta.go +++ b/x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta/okta.go @@ -385,7 +385,7 @@ func oktaRateLimit(h http.Header, window time.Duration, limiter *rate.Limiter, l rateLimit := rate.Limit(rem / per) // Process reset if we need to wait until reset to avoid a request against a zero quota. - if rateLimit == 0 { + if rateLimit <= 0 { waitUntil := resetTime.UTC() // next gives us a sane next window estimate, but the // estimate will be overwritten when we make the next