mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
35 lines
No EOL
752 B
Text
35 lines
No EOL
752 B
Text
# @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;
|
|
} |