diff --git a/scripts/base/frameworks/cluster/main.zeek b/scripts/base/frameworks/cluster/main.zeek index d73093a8cf..3ac6ab0c7d 100644 --- a/scripts/base/frameworks/cluster/main.zeek +++ b/scripts/base/frameworks/cluster/main.zeek @@ -56,12 +56,10 @@ export { ## relevant to all nodes in a cluster. Currently, there is not a common ## topic to broadcast to, because enabling implicit Broker forwarding would ## cause a routing loop for this topic. - const broadcast_topics = { - logger_topic, - manager_topic, - proxy_topic, - worker_topic, - }; + ## + ## Note that with :zeek:see:`Cluster::enable_global_pub_sub` and non-Broker + ## backends a single broadcast topic has become an option. + const broadcast_topics: set[string] = set() &ordered; ## The topic prefix used for exchanging messages that are relevant to ## a named node in a cluster. Used with broker-enabled cluster communication. @@ -552,6 +550,13 @@ event node_down(name: string, id: string) &priority=10 name, id)); } +event zeek_init() &priority=1000 + { + # Populate broadcast_topics based on redef'ble consts. + for ( _, topic in vector(manager_topic, logger_topic, worker_topic, proxy_topic) ) + add broadcast_topics[topic]; + } + event zeek_init() &priority=5 { # If a node is given, but it's an unknown name we need to fail.