forked from openshift/origin-aggregated-logging
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
9 changed files
with
190 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
rsyslog/vendored_src/liblognorm/liblognorm/tests/field_json_skipempty.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# added 2018-08-27 by Noriko Hosoi | ||
# This file is part of the liblognorm project, released under ASL 2.0 | ||
. $srcdir/exec.sh | ||
|
||
test_def $0 "JSON field" | ||
add_rule 'version=2' | ||
add_rule 'rule=:%field:json%' | ||
|
||
# default behaviour | ||
execute '{"f1": "1", "f2": 2, "f3": "", "f4": {}, "f5": []}' | ||
assert_output_json_eq '{ "field": { "f1": "1", "f2": 2 , "f3": "", "f4": {}, "f5": []} }' | ||
|
||
# skip empty json values | ||
reset_rules | ||
add_rule 'version=2' | ||
add_rule 'rule=:%field:json:skipempty%' | ||
|
||
execute '{"f1": "1", "f2": 2, "f3": "", "f4": {}, "f5": []}' | ||
assert_output_json_eq '{ "field": { "f1": "1", "f2": 2 } }' | ||
|
||
# undefined parameter has to be ignored? | ||
reset_rules | ||
add_rule 'version=2' | ||
add_rule 'rule=:%field:json:bogus%' | ||
|
||
execute '{"f1": "1", "f2": 2, "f3": "", "f4": {}, "f5": []}' | ||
assert_output_json_eq '{ "field": { "f1": "1", "f2": 2 , "f3": "", "f4": {}, "f5": []} }' | ||
|
||
cleanup_tmp_files | ||
|