Fix the to_json() function for bool, enum, and interval types

This commit is contained in:
Daniel Thayer 2017-02-02 12:09:40 -06:00
parent 9370db8980
commit 65d6e5a4f7
2 changed files with 12 additions and 8 deletions

View file

@ -25,6 +25,10 @@ function to_json(v: any, only_loggable: bool &default=F, field_escape_pattern: p
case "port":
return cat(port_to_count(to_port(cat(v))));
case "enum":
fallthrough;
case "interval":
fallthrough;
case "addr":
fallthrough;
case "subnet":
@ -37,12 +41,12 @@ function to_json(v: any, only_loggable: bool &default=F, field_escape_pattern: p
case "time":
fallthrough;
case "double":
fallthrough;
case "bool":
fallthrough;
case "enum":
return cat(v);
case "bool":
local bval: bool = v;
return bval ? "true" : "false";
default:
break;
}