mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Fix similar issues with ValueTo* methods in the input framework
This commit is contained in:
parent
d6116b0141
commit
04c201393f
4 changed files with 87 additions and 12 deletions
|
@ -0,0 +1,35 @@
|
|||
# @TEST-EXEC: btest-bg-run zeek zeek -b %INPUT
|
||||
# @TEST-EXEC: btest-bg-wait 10
|
||||
# @TEST-EXEC: btest-diff zeek/.stderr
|
||||
# @TEST-EXEC: btest-diff zeek/.stdout
|
||||
|
||||
@TEST-START-FILE denylist.txt
|
||||
#separator \x09
|
||||
#fields ip colors
|
||||
192.168.17.1 Red,White
|
||||
192.168.27.2 White,asdf
|
||||
192.168.250.3 Blue
|
||||
@TEST-END-FILE
|
||||
|
||||
# test.zeek
|
||||
type Idx: record {
|
||||
ip: addr;
|
||||
};
|
||||
|
||||
type Color: enum { Red, White, Blue, };
|
||||
|
||||
type Val: record {
|
||||
colors: set[Color];
|
||||
};
|
||||
|
||||
global denylist: table[addr] of Val = table();
|
||||
|
||||
event zeek_init() {
|
||||
Input::add_table([$source="../denylist.txt", $name="denylist",
|
||||
$idx=Idx, $val=Val, $destination=denylist]);
|
||||
Input::remove("denylist");
|
||||
}
|
||||
|
||||
event Input::end_of_data(name: string, source: string) {
|
||||
print denylist;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue