ActiveHTTP Module Error

Hi all,

I’m having difficulty using the ActiveHTTP module to make an HTTP request in my zeek script. Here is a snippet of the code and output:

Script:
print(“MAKING A REQUEST”);
when (local response = ActiveHTTP::request([$url=“https://google.com”, $method=“GET”]))
{
print(response$msg);
}
print (“AFTER WHEN BLOCK”);

There's an example in
testing/btest/scripts/base/utils/active-http.test. In your example,
if you're running from the command line and/or reading a pcap, you
need to add this:

    redef exit_only_after_terminate = T;

That is, "when" statements and the ActiveHTTP modules are executed
asynchronously. The block of code within the "when" gets executed
whenever the results are ready, and if you're on command-line without
an indefinite source of input, the process exits before the results
are obtained.

- Jon

Great, that is what I was missing! Thank you!