base/bif/cluster.bif.zeek

Cluster
GLOBAL
Namespaces:

Cluster, GLOBAL

Summary

Functions

Cluster::Backend::__init: function

Initialize the global cluster backend.

Cluster::__subscribe: function

Cluster::__unsubscribe: function

Cluster::make_event: function

Create a data structure that may be used to send a remote event via Broker::publish.

Cluster::publish: function

Publishes an event to a given topic.

Cluster::publish_hrw: function

Publishes an event to a node within a pool according to Rendezvous (Highest Random Weight) hashing strategy.

Cluster::publish_rr: function

Publishes an event to a node within a pool according to Round-Robin distribution strategy.

Detailed Interface

Functions

Cluster::Backend::__init
Type:

function () : bool

Initialize the global cluster backend.

Returns:

true on success.

Cluster::__subscribe
Type:

function (topic_prefix: string) : bool

Cluster::__unsubscribe
Type:

function (topic_prefix: string) : bool

Cluster::make_event
Type:

function (…) : Cluster::Event

Create a data structure that may be used to send a remote event via Broker::publish.

Parameters:

args – an event, followed by a list of argument values that may be used to call it.

Returns:

A Cluster::Event instance that can be published via Cluster::publish, Cluster::publish_rr or Cluster::publish_hrw.

Cluster::publish
Type:

function (…) : bool

Publishes an event to a given topic.

Parameters:
  • topic – a topic associated with the event message.

  • args – Either the event arguments as already made by Cluster::make_event or the argument list to pass along to it.

Returns:

true if the message is sent.

Cluster::publish_hrw
Type:

function (…) : bool

Publishes an event to a node within a pool according to Rendezvous (Highest Random Weight) hashing strategy.

Parameters:
  • pool – the pool of nodes that are eligible to receive the event.

  • key – data used for input to the hashing function that will uniformly distribute keys among available nodes.

  • args – Either the event arguments as already made by Broker::make_event or the argument list to pass along to it.

Returns:

true if the message is sent.

Cluster::publish_rr
Type:

function (…) : bool

Publishes an event to a node within a pool according to Round-Robin distribution strategy.

Parameters:
  • pool – the pool of nodes that are eligible to receive the event.

  • key – an arbitrary string to identify the purpose for which you’re distributing the event. e.g. consider using namespacing of your script like “Intel::cluster_rr_key”.

  • args – Either the event arguments as already made by Cluster::make_event or the argument list to pass along to it.

Returns:

true if the message is sent.