[Bro] how to split a substring from string?

Seth Hall hall.692 at osu.edu
Wed Oct 29 07:19:57 PDT 2008

On Oct 29, 2008, at 5:28 AM, hossein talebi wrote:

> i have a local variable and i want split a substring from this  
> variable
> for example: "abccadfjmklma"
> i want to split from 5th character  to 8th character

You can use the sub_bytes built in function.

event bro_init()
         local var = "abccadfjmklma";
         print sub_bytes(var, 5, 4);

That function and all other string-centric BiFs are defined in  
strings.bif.bro in your policy directory.


Seth Hall
Network Security - Office of the CIO
The Ohio State University
Phone: 614-292-9721

More information about the Bro mailing list