-
Notifications
You must be signed in to change notification settings - Fork 1.9k
filter_geoip2: Allow nested lookup paths beyond depth 2 #11372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughIncreased the split limit used when parsing GeoIP key paths from 2 to 8 in the geoip2 plugin, causing up to eight path components to be considered when looking up values in the MMDB. No other control flow or error handling changed. (27 words) Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
0046c79 to
32e76cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@plugins/filter_geoip2/geoip2.c`:
- Line 243: The code currently calls flb_utils_split(key, '.', 4) which limits
path depth to 4 segments; change the call to use an unbounded split by passing 0
(or the API's "no limit" sentinel) as the max_parts argument so deep nested keys
are fully split—update the use around the variable split and all logic that
iterates over the returned tokens (e.g., any loop that uses split->entries or
similar) to handle an arbitrary number of segments safely.
32e76cc to
4d9b09d
Compare
4d9b09d to
6005116
Compare
geoip2 filter limited lookup path splitting to depth 2, which caused nested paths like 'subdivisions.0.names.en' to be truncated and fail at runtime. This change allows unlimited nesting by using flb_utils_split(..., 4), making array-backed fields such as subdivisions accessible. So, we need to accept subdivitions elements. For example, the following configuration could be broken on loading because of containing three dots or more. Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
6005116 to
bde669d
Compare
geoip2 filter limited lookup path splitting to depth 2, which caused nested paths like 'subdivisions.0.names.en' to be truncated and fail at runtime.
This change allows unlimited nesting by using flb_utils_split(..., 8), making array-backed fields such as subdivisions accessible.
For example,
the following configuration could be broken on loading because of containing three dots:
Closes #11287.
Enter
[N/A]in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-testlabel to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.