mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 04:58:21 +00:00
Fix the to_json() function for bool, enum, and interval types
This commit is contained in:
parent
9370db8980
commit
65d6e5a4f7
2 changed files with 12 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue