[syslog-ng] [PATCH (3.4) 3/4] json-parser: Implement boolean parsing.

Gergely Nagy algernon at balabit.hu
Tue Jan 10 13:11:08 CET 2012


Signed-off-by: Gergely Nagy <algernon at balabit.hu>
---
 modules/jsonparser/jsonparser.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/jsonparser/jsonparser.c b/modules/jsonparser/jsonparser.c
index 24249f9..cbe07fa 100644
--- a/modules/jsonparser/jsonparser.c
+++ b/modules/jsonparser/jsonparser.c
@@ -62,8 +62,11 @@ log_json_parser_process_object (struct json_object *jso,
       switch (json_object_get_type (itr.val))
         {
         case json_type_boolean:
-          msg_info ("JSON parser does not support boolean types yet, skipping",
-                    evt_tag_str ("key", itr.key), NULL);
+          parsed = TRUE;
+          if (json_object_get_boolean (itr.val))
+            g_string_assign (sb_string (value), "true");
+          else
+            g_string_assign (sb_string (value), "false");
           break;
         case json_type_double:
           parsed = TRUE;
-- 
1.7.7.3




More information about the syslog-ng mailing list