Getting the Output From system()

Say I wanted a bro script to call out to an external program, and I wanted to get the output from the external program into my bro script.

This thread shows that I can call an external program with system():

Based on the old bro wiki, it looks like the output from that command gets redirected to stderr:

Is there anything like system() that returns the output of an external command?


I hate that I'm even pointing this out on the mailing list, but here it goes…

You can do it with the input framework and system command together. I have a minimal example that I wrote for the SecurityOnion guys for their Bro installation. This script runs the hostname command and collects the output.

Have fun. :slight_smile: