Added optional script and redef bool to enable utf-8 in ASCII logs

This commit is contained in:
Dev Bali 2019-07-22 10:28:38 -07:00
parent 6927dd1213
commit 66557d3178
10 changed files with 111 additions and 2 deletions

View file

@ -0,0 +1,26 @@
#
# @TEST-EXEC: zeek -b %INPUT
# @TEST-EXEC: btest-diff test.log
@load tuning/enable-utf-8-logs
module Test;
export {
redef enum Log::ID += { LOG };
type Log: record {
s: string;
} &log;
}
event zeek_init()
{
local a = "foo \xc2\xae bar"; # 2 bytes
local b = "दुनिया को नमस्ते"; # Hindi characters are 3 byte utf-8
local c = "hello 𠜎"; # A 4 byte Chinese character
Log::create_stream(Test::LOG, [$columns=Log]);
Log::write(Test::LOG, [$s=a]);
Log::write(Test::LOG, [$s=b]);
Log::write(Test::LOG, [$s=c]);
}