mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
24 lines
636 B
Text
24 lines
636 B
Text
# @TEST-DOC: Cluster::on_subscribe and Cluster::on_unsubscribe hooks
|
|
#
|
|
# @TEST-EXEC: zeek --parse-only -b %INPUT
|
|
# @TEST-EXEC: zeek -b %INPUT
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stdout
|
|
|
|
hook Cluster::on_subscribe(topic: string)
|
|
{
|
|
print "on_subscribe", topic;
|
|
}
|
|
|
|
hook Cluster::on_unsubscribe(topic: string)
|
|
{
|
|
print "on_unsubscribe", topic;
|
|
}
|
|
|
|
event zeek_init()
|
|
{
|
|
Cluster::subscribe("/my_topic");
|
|
Cluster::unsubscribe("/my_topic");
|
|
Cluster::unsubscribe("/my_topic");
|
|
Cluster::subscribe("/my_topic2");
|
|
}
|