[Bro] loading scripts only if file exists

Dirk Leinenbach dirk.leinenbach at consistec.de
Fri Jan 15 07:01:02 PST 2016


Hi Seth,

 1. Is “local.local.bro”a hard-coded name that will always work, even
    without extending @prefixes?
 2. If I extend @prefixes inside a plugin script, which directory would
    be searched? E.g., if I extend prefixes in the following file:

            /opt/bro/lib/bro/plugins/Demo_demo/scripts/Demo/demo/bla.bro
            @prefixes = myprefix

            while my bro plugin search path is: /opt/bro/lib/bro/plugins


        If I understand the documentation correctly, this would search
        for files named

            myprefix.Demo_demo.scripts.Demo.demo.bla.bro


        Is that correct?


Thanks a lot!

Dirk

On 13.01.2016 18:04, Seth Hall wrote:
>> On Jan 13, 2016, at 11:23 AM, Dirk Leinenbach <dirk.leinenbach at consistec.de> wrote:
>>
>> I've tried to use @prefixes to conditionally load scripts, but couldn't
>> figure out exactly where bro would be searching for those scripts.
> I think that prefixes are probably exactly what you’re looking for.  If you add a prefix and then create a file by the right name it will only load it when it finds the file.  This is a little tricky with the current setup unfortunately, I didn’t get this setup quite the way I wanted to a number of years ago.
>
> If you write a file named “local.local.bro” to your site/ directory, that script will automatically load if it’s found.
>
>> If there an equivalent for something like "if [-f /etc/bro-config.bro] " ?
> 
> Not really.
>
>    .Seth
>
> --
> Seth Hall
> International Computer Science Institute
> (Bro) because everyone has a network
> http://www.bro.org/
>

-- 

Dr.-Ing. Dirk Leinenbach - Leitung Softwareentwicklung
consistec Engineering & Consulting GmbH
------------------------------------------------------------------

Europaallee 5                      Fon:   +49 (0)681 / 959044-0
D-66113 Saarbrücken                Fax:   +49 (0)681 / 959044-11
http://www.consistec.de            e-mail: dirk.leinenbach at consistec.de

Registergericht: Amtsgericht Saarbrücken
Registerblatt:   HRB12003
Geschäftsführer: Dr. Thomas Sinnwell, Volker Leiendecker, Stefan Sinnwell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20160115/ee06442f/attachment.html 


More information about the Bro mailing list