-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Standard way for nested record support #1578
Comments
+1 for jsonpath-like syntax, but we need to add bracket–notation to support a key containing
|
I'm a big fan of the enable_ruby approach because it generally can help solve this, but also offers a lot of other niceties I'd like to see in other plugins. That said, I think it's probably a bit of a bigger scope and I'd still like to see this handled without the enable_ruby approach which can have potentially much higher overhead if all you want to do is access nested keys. Overall I think jsonpath looks very reasonable, although feels somewhat inconsistent with how you access fields that aren't nested which I dislike, but I guess there's not many options unless you throw out backwards compatibility. |
No more comment. So I wrote a patch for it: #1637 |
Awesome, I like that it's got the two notations to handle cases with dots, and such. |
@repeatedly how can this be used with |
@jhuenges Now way for now because this helper doesn't provide nested deletion. |
Is there any way to delete something that is not on the top level of a json? {
"request": {
"headers": {
...
"cookie": "abcdf",
...
}
} And I want to remove the |
@jhuenges Were you able to find a solution for this? @repeatedly I have a similar issue, we have this structure:
From above, I would like remove from the record so the result shoule be:
|
Ok, I figured it out :) Seems it was failing because not all records have the
|
Nested delete support: #1800 |
can we update nested fields of a json?? |
This is for fixing #649, #902 and related issues.
Currently, many plugins can't handle nested record because there is no standard way.
Many users want to access nested record. For example, grep, rewrite-tag-filter, parser and more plugins.
Fluentd core should provide the way to handle these cases.
Here is a starting point. We need the feedback and suggestion!
Features
Configuration
What is the best syntax for configuration? There are several approaches.
Use grep filter plugin as an example:
jsonpath like synax
.
separated keyHow to handle
record["key1"]["key2"]
andrecord["key1.key2"]
pattern?support array
record_transformer with enable_ruby syntax
key1
is same asrecord["key"]
for backward compatibilityor good syntax?
Plugin helper
For internal implementation, We can use
dig
method to access nested values since ruby 2.4. For ruby 2.2 or earlier, we can use ruby_dig or backport_dig.For plugin API, there are several approaches:
Return accessor object
Provide access method
This is similar to inject helper.
Plugin helper needs to maintain accessor list internally.
or good API?
The text was updated successfully, but these errors were encountered: