mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
BIT-1779: use BRO_LOG_SUFFIX env var in ascii log rotation function
This commit is contained in:
parent
e275927a64
commit
4bbdd63054
1 changed files with 6 additions and 2 deletions
|
@ -81,10 +81,14 @@ function default_rotation_postprocessor_func(info: Log::RotationInfo) : bool
|
|||
{
|
||||
# If the filename has a ".gz" extension, then keep it.
|
||||
local gz = info$fname[-3:] == ".gz" ? ".gz" : "";
|
||||
local bls = getenv("BRO_LOG_SUFFIX");
|
||||
|
||||
if ( bls == "" )
|
||||
bls = "log";
|
||||
|
||||
# Move file to name including both opening and closing time.
|
||||
local dst = fmt("%s.%s.log%s", info$path,
|
||||
strftime(Log::default_rotation_date_format, info$open), gz);
|
||||
local dst = fmt("%s.%s.%s%s", info$path,
|
||||
strftime(Log::default_rotation_date_format, info$open), bls, gz);
|
||||
|
||||
system(fmt("/bin/mv %s %s", info$fname, dst));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue