# Passing options to Bro plugins from a file

**URL:** <https://community.zeek.org/t/passing-options-to-bro-plugins-from-a-file/3757>\
**Category:** Zeek\
**Created:** [August 9, 2015, 11:45pm UTC](https://community.zeek.org/t/passing-options-to-bro-plugins-from-a-file/3757 "2015-08-09T23:45:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary\_Faulkner1](https://avatars.discourse-cdn.com/v4/letter/g/aeb1de/32.png) [@Gary\_Faulkner1](https://community.zeek.org/u/Gary_Faulkner1)\
**Post date:** [August 9, 2015, 11:45pm UTC](https://community.zeek.org/t/passing-options-to-bro-plugins-from-a-file/3757/1 "2015-08-09T23:45:01Z")

</div>

I'd like to read options into a plugin such as IP addresses, hostnames,  
ports, etc from a configuration file. Looking at the redis plugin for  
inspiration, it looks like I could set types in the bif, set initial  
values in the plugin's init.bro and then redef in local.bro? Is this  
correct? Am I missing anything?

For example I'd like to have a bro script that can call a function from  
scriptland to shove data into external DB. A use case may be something  
such as writing time series data directly to InfluxDB. Instead of hard  
coding the IP, port, etc into the plugin I'd like to be able to specify  
the location in a file. I might also use the file to define a tag  
structure for InfluxDB.

---

<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, 2015, 3:00pm UTC](https://community.zeek.org/t/passing-options-to-bro-plugins-from-a-file/3757/2 "2015-08-10T15:00:59Z")

</div>

Yes, correct. It's kind of the "normal" Bro way: you define a set of  
global options with defaults through the bifs and people can redef  
them as they need to. A few of the plugins do it this way, another  
example is dataseries/src/dataseries.bif.

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:42pm UTC](https://community.zeek.org/t/passing-options-to-bro-plugins-from-a-file/3757/3 "2022-05-06T15:42:57Z")

</div>


