mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
parent
88509e2191
commit
ff7b92ffc8
3 changed files with 32 additions and 1 deletions
|
@ -1089,7 +1089,7 @@ LogVal** LogMgr::RecordToFilterVals(Stream* stream, Filter* filter,
|
|||
if ( ! val )
|
||||
{
|
||||
// Value, or any of its parents, is not set.
|
||||
vals[i] = new LogVal(type, false);
|
||||
vals[i] = new LogVal(filter->fields[i]->type, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
3
testing/btest/Baseline/logging.unset-record/testing.log
Normal file
3
testing/btest/Baseline/logging.unset-record/testing.log
Normal file
|
@ -0,0 +1,3 @@
|
|||
# a.val1 a.val2 b
|
||||
- - 6
|
||||
1 2 3
|
28
testing/btest/logging/unset-record.log
Normal file
28
testing/btest/logging/unset-record.log
Normal file
|
@ -0,0 +1,28 @@
|
|||
#
|
||||
# @TEST-EXEC: bro %INPUT
|
||||
# @TEST-EXEC: btest-diff testing.log
|
||||
|
||||
redef enum Log::ID += { TESTING };
|
||||
|
||||
type Foo: record {
|
||||
val1: count;
|
||||
val2: count;
|
||||
} &log;
|
||||
|
||||
type Bar: record {
|
||||
a: Foo &log &optional;
|
||||
b: count &log;
|
||||
};
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
Log::create_stream(TESTING, [$columns=Bar]);
|
||||
|
||||
local x: Bar;
|
||||
|
||||
x = [$b=6];
|
||||
Log::write(TESTING, x);
|
||||
|
||||
x = [$a=[$val1=1,$val2=2], $b=3];
|
||||
Log::write(TESTING, x);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue