Hi all,
I have been experiencing some difficulties in understanding the usage of Broker.
I have a cluster and I wish bro workers to notify a single python script with a costume text message.
On the python side I use pybroker.
Do I need to use listen for the python side and send on the bro side ?
How does the publishing works ?
how can I implement it ?
Thank you
B
Hi,
I have a cluster and I wish bro workers to notify a single python script
with a costume text message.
On the python side I use pybroker.
Do I need to use listen for the python side and send on the bro side ?
How does the publishing works ?
This is a twofold question. First - broker has to connect python and Bro.
For that it actually is completely up to you; you can either have python
listen for connections of Bro or vice-versa. The connection is
bidirectional afterwards, it does not matter who established it.
After that, the python side has to subscribe to the correct events, and
the Bro side has to send them.
The best way is to probably look at examples; the best example nowadays
are probably the netcontrol connectors.
https://github.com/bro/bro/blob/master/scripts/base/frameworks/netcontrol/plugins/broker.bro
is the script that sends out netcontrol events,
https://github.com/bro/bro-netcontrol/blob/master/netcontrol/api.py it the
script that implements the API for listening to events.
Note that the python and Bro API for Broker are not fixed yet and will
change in the future.
I hope this helps a bit,
Johanna