Re: [Bro-Dev] How to use Broker::Data in an event handler?

2018-09-12 Thread Matthias Vallentin
> case type Broker::Data as d: > print "Broker::Data, expected to be nil", d?$data, d?$data ? > cat(d$data) : "nil"; > # or use the same logic from the is_nil() function above This is the logic I was looking for, thanks! The generic is_nil function might come in handy some othe

Re: [Bro-Dev] How to use Broker::Data in an event handler?

2018-09-11 Thread Jon Siwek
On Tue, Sep 11, 2018 at 5:52 AM Matthias Vallentin wrote: > One more question: how would I capture a default-constructed > broker::Data() in a case statement? This would happen when I publish > just "None" on the Python side. In Bro, it shows up on the command > line as "broker::data{nil}". Ther

Re: [Bro-Dev] How to use Broker::Data in an event handler?

2018-09-11 Thread Matthias Vallentin
> This, plus a couple other bugs should now be fixed in bro + broker, so make sure to update both if trying the above examples. Great, it works now! One more question: how would I capture a default-constructed broker::Data() in a case statement? This would happen when I publish just "None" on the

Re: [Bro-Dev] How to use Broker::Data in an event handler?

2018-09-10 Thread Jon Siwek
On Mon, Sep 10, 2018 at 8:01 AM Matthias Vallentin wrote: > > I'm trying to figure out if/how it is possible to use Broker::Data in an > event handler as follows: > > event foo(x: Broker::Data) > { > print x; > } No, but you can try to use 'any' instead of 'Broker::Data'. E

[Bro-Dev] How to use Broker::Data in an event handler?

2018-09-10 Thread Matthias Vallentin
I'm trying to figure out if/how it is possible to use Broker::Data in an event handler as follows: event foo(x: Broker::Data) { print x; } I'm trying to send an event via the Python bindings: event = broker.bro.Event("foo", broker.Data(42)) endpoint.publish("/test"