Add a parameter skipempty to the json field type.#305
Add a parameter skipempty to the json field type.#305nhosoi wants to merge 1 commit intorsyslog:masterfrom
Conversation
If skipempty is set as follows, empty json objects are dropped from
the parsed result.
%field_name:json:skipempty%
If any parameter other than "skipempty" is given ("bogus" in this
example), an error message "invalid flag for JSON parser: bogus"
is issued.
Add test for the skipempty parameter.
|
Dependency on libfastjson needs to be updated to 0.99.8 or later to pick up rsyslog/libfastjson#155 |
|
@rgerhards, sorry about this slow post. I double-checked libfastjson and learned rsyslog/libfastjson#155 is merged to the master branch, but it's not in the tagged release. The latest libfastjson version is v0.99.8 which was released on Dec 18 2017 and 9 commits were merged to the master branch since then. pr/155 is one of them. Thus, this pr fails the tests even with the libfastjson v0.99.8... :( It requires new version of libfastjson including rsyslog/libfastjson#155.
Note: it's a bit tricky since libfastjson v0.99.8 contains this commit pr#155, which is different from what we'd like to have. Could there be a plan to release libfastjson 0.99.9 containing the 9 commits? And does this PR have a chance to be tested and merged? Thanks! |
libfastjson - Adding "void fjson_object_array_del_idx(struct fjson_object *jso, int idx)", which deletes the idx-th element in the array type object. upstream PR: rsyslog/libfastjson#155 liblognorm - Adding a parameter skipempty to the json field type. If skipempty is set as follows, empty json objects are dropped from the parsed result. %field_name:json:skipempty% If any parameter other than "skipempty" is given ("bogus" in this example), an error message "invalid flag for JSON parser: bogus" is issued. Add test for the skipempty parameter. upstream PR: rsyslog/liblognorm#305
|
Hi, libfastjson has been rebased to 0.99.9 . Could you rerun the tests with the latest libfastjson? |
If skipempty is set as follows, empty json objects are dropped from
the parsed result.
%field_name:json:skipempty%
If any parameter other than "skipempty" is given ("bogus" in this
example), an error message "invalid flag for JSON parser: bogus"
is issued.
Add test for the skipempty parameter.