zeek/auxil/zeekjs/examples/set-record-fields.zeek
Patrick Kelley 8fd444092b initial
2025-05-07 15:35:15 -04:00

21 lines
357 B
Plaintext

# The JS code implements the Test::policy hook and modifies the s field.
@load ./set-record-fields.js
module Test;
export {
type MyRecord: record {
s: string;
};
global Test::policy: hook(r: MyRecord);
}
event zeek_init() {
local r: MyRecord = [$s="hello"];
print fmt("ZEEK: %s", r);
hook Test::policy(r);
print fmt("ZEEK: %s", r);
}