Thanks, I found this right after I hit “send” on my mail.
Here is what I came up with to save anyone else a little bit of time:
if there is a better way of doing it, please let me know. So far these are the logs I’ve been able to add the interface too. Communications.log did not work using the same pattern.
—====================================================================================================================
#add interface name to log filename:
event bro_init()
{
if ( reading_live_traffic() )
{
Log::remove_default_filter(HTTP::LOG);
Log::add_filter(HTTP::LOG, [$name = “http-interfaces”,
$path_func(id: Log::ID, path: string, rec: HTTP::Info) =
{
local peer = get_event_peer()$descr;
if ( peer in Cluster::nodes && Cluster::nodes[peer]?$interface )
return cat(“http_”, Cluster::nodes[peer]$interface);
else
return “http”;
}
]);
Log::remove_default_filter(Conn::LOG);
Log::add_filter(Conn::LOG, [$name = “conn-interfaces”,
$path_func(id: Log::ID, path: string, rec: Conn::Info) =
{
local peer = get_event_peer()$descr;
if ( peer in Cluster::nodes && Cluster::nodes[peer]?$interface )
return cat(“conn_”, Cluster::nodes[peer]$interface);
else
return “conn”;
}
]);
Log::remove_default_filter(Weird::LOG);
Log::add_filter(Weird::LOG, [$name = “weird-interfaces”,
$path_func(id: Log::ID, path: string, rec: Weird::Info) =
{
local peer = get_event_peer()$descr;
if ( peer in Cluster::nodes && Cluster::nodes[peer]?$interface )
return cat(“weird_”, Cluster::nodes[peer]$interface);
else
return “weird”;
}
]);
Log::remove_default_filter(DNS::LOG);
Log::add_filter(DNS::LOG, [$name = “DNS-interfaces”,
$path_func(id: Log::ID, path: string, rec: DNS::Info) =
{
local peer = get_event_peer()$descr;
if ( peer in Cluster::nodes && Cluster::nodes[peer]?$interface )
return cat(“DNS_”, Cluster::nodes[peer]$interface);
else
return “dns”;
}
]);
} #end if
} #end event
—====================================================================================================================
In your logs folder, each logfile will be split up by the interface:
DNS_eth01.log
DNS_eth02.log
weird_eth01.log
weird_eth02.log