# question about plugin init

**URL:** <https://community.zeek.org/t/question-about-plugin-init/4294>\
**Category:** Zeek\
**Created:** [August 9, 2016, 2:05am UTC](https://community.zeek.org/t/question-about-plugin-init/4294 "2016-08-09T02:05:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dk\_Jack](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@Dk\_Jack](https://community.zeek.org/u/Dk_Jack)\
**Post date:** [August 9, 2016, 2:05am UTC](https://community.zeek.org/t/question-about-plugin-init/4294/1 "2016-08-09T02:05:49Z")

</div>

Hi,  
I am trying write a bro analyzer plugin. My directory structure for my plugin is shown below.  
My scripts **load**.bro loads my init.bro and analyzer/test/test.bro. My test.bro file registers  
for ‘event bro\_init’ in which I am registering for some ports. Even though I can see both my bro  
scripts are loaded in loaded\_scripts.log, my bro\_init event is never triggered and hence I never  
register for my ports. I can it’s not being invoked because, my print in that function don’t show  
and up and it doesn’t complain even if I put syntactically incorrect code in my bro\_init function.  
Could someone shed some light on why my bro\_init event is not getting triggered or if I am  
doing something wrong. Thanks.

Dk.

> – **bro\_plugin**  
> – lib
> 
> > – [analyzer-test.linux-x86\_64.so](http://analyzer-test.linux-x86_64.so)  
> > `-- bif -- __load__.bro -- events.bif.bro `– test.bif.bro  
> > `-- scripts -- __load__.bro -- analyzer `– test  
> > – **load**.bro  
> > `-- test.bro `– init.bro

---

<div class="post-metadata">

**Author:** ![Dk\_Jack](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@Dk\_Jack](https://community.zeek.org/u/Dk_Jack)\
**Post date:** [August 9, 2016, 11:57pm UTC](https://community.zeek.org/t/question-about-plugin-init/4294/2 "2016-08-09T23:57:27Z")

</div>

could some please comment on my query.

Another related question, can two protocol analyzer modules register for the same dpd signature? thanks.

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [August 10, 2016, 4:17pm UTC](https://community.zeek.org/t/question-about-plugin-init/4294/3 "2016-08-10T16:17:33Z")

</div>

> Could someone shed some light on why my bro\_init event is not getting  
> triggered or if I am doing something wrong.

This would be easiest to debug with the actual code. Can you send me a  
tar file of your plugin off-list?

Robin

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [August 10, 2016, 4:20pm UTC](https://community.zeek.org/t/question-about-plugin-init/4294/4 "2016-08-10T16:20:30Z")

</div>

Yes, if memory serves me right, adding two separate 'enable "..."'  
statements to a signature should work fine.

Robin

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:43pm UTC](https://community.zeek.org/t/question-about-plugin-init/4294/5 "2022-05-06T15:43:56Z")

</div>


