how to split a substring from string?

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.