mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Fix ascii writer to not discard a ".gz" file extension
When Bro writes a compressed log, it uses a file extension of ".gz". However, upon log rotation the ascii writer script function "default_rotation_postprocessor_func" was discarding the ".gz" file extension. Fixed so that the correct file extension is preserved after rotation.
This commit is contained in:
parent
5efaaf1368
commit
823fba1713
1 changed files with 5 additions and 2 deletions
|
@ -79,9 +79,12 @@ export {
|
|||
# runs the writer's default postprocessor command on it.
|
||||
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" : "";
|
||||
|
||||
# Move file to name including both opening and closing time.
|
||||
local dst = fmt("%s.%s.log", info$path,
|
||||
strftime(Log::default_rotation_date_format, info$open));
|
||||
local dst = fmt("%s.%s.log%s", info$path,
|
||||
strftime(Log::default_rotation_date_format, info$open), gz);
|
||||
|
||||
system(fmt("/bin/mv %s %s", info$fname, dst));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue