Log-extensions scripting issue


I’m using the script below, but when presented in my logs the field is _my_server_name instead of my_server_name. I’ve tried multiple ways at removing the initial underscore but being new to this scripting I can’t seem to resolve the issue.

option my_server_name = “Zeek-server1”;

type MyLogExtension: record {
server_name: string &log;

function add_my_log_extension(path: string): MyLogExtension
return MyLogExtension($server_name = my_server_name);

redef Log::default_ext_func = add_my_log_extension;

Try adding:

redef Log::default_ext_prefix: string = "";

(edited to remove smart quotes)

1 Like

Thank you this appears to have solved the issue.