Merge remote-tracking branch 'origin/topic/vlad/expose_supervisor_rotation_func'

- Restored a deprecated version of 'supervisor_rotation_format_func'
  during merge.

* origin/topic/vlad/expose_supervisor_rotation_func:
  Rename supervisor_rotation_format_func to archiver_rotation_format_func, and expose it for non-supervised setups
This commit is contained in:
Jon Siwek 2021-03-26 17:14:55 -07:00
commit 7bf885b0b8
4 changed files with 20 additions and 7 deletions

View file

@ -1,4 +1,10 @@
4.1.0-dev.426 | 2021-03-26 17:17:45 -0700
* GH-1463: Rename supervisor_rotation_format_func to archiver_rotation_format_func (Vlad Grigorescu)
And expose it for non-supervised setups. Also deprecates the old name.
4.1.0-dev.423 | 2021-03-26 16:44:26 -0700 4.1.0-dev.423 | 2021-03-26 16:44:26 -0700
* GH-1454: Heartbleed: fix substraction order. (Johanna Amann) * GH-1454: Heartbleed: fix substraction order. (Johanna Amann)

2
NEWS
View file

@ -74,6 +74,8 @@ Deprecated Functionality
environment variables prefixed by ``BRO_`` is now removed and calling environment variables prefixed by ``BRO_`` is now removed and calling
``getenv()`` directly with ``ZEEK_`` environment variables can be done. ``getenv()`` directly with ``ZEEK_`` environment variables can be done.
- ``supervisor_rotation_format_func`` is renamed to ``archiver_rotation_format_func``
Zeek 4.0.0 Zeek 4.0.0
========== ==========

View file

@ -1 +1 @@
4.1.0-dev.423 4.1.0-dev.426

View file

@ -22,11 +22,10 @@ redef Log::default_rotation_interval = 1 hrs;
## Alarm summary mail interval. ## Alarm summary mail interval.
redef Log::default_mail_alarms_interval = 24 hrs; redef Log::default_mail_alarms_interval = 24 hrs;
@if ( Supervisor::is_supervised() ) ## This function will rotate logs in a format compatible with zeek-archiver.
## If you're using the Supervisor framework, this function will be used,
redef Log::default_rotation_dir = "log-queue"; ## if not, you can set :zeek:see:`Log::rotation_format_func` to this function.
function archiver_rotation_format_func(ri: Log::RotationFmtInfo): Log::RotationPath
function supervisor_rotation_format_func(ri: Log::RotationFmtInfo): Log::RotationPath
{ {
local open_str = strftime(Log::default_rotation_date_format, ri$open); local open_str = strftime(Log::default_rotation_date_format, ri$open);
local close_str = strftime(Log::default_rotation_date_format, ri$close); local close_str = strftime(Log::default_rotation_date_format, ri$close);
@ -35,7 +34,13 @@ function supervisor_rotation_format_func(ri: Log::RotationFmtInfo): Log::Rotatio
return rval; return rval;
} }
redef Log::rotation_format_func = supervisor_rotation_format_func; @if ( Supervisor::is_supervised() )
global supervisor_rotation_format_func = archiver_rotation_format_func &deprecated="Remove in v5.1. Use 'archiver_rotation_format_func'.";
redef Log::default_rotation_dir = "log-queue";
redef Log::rotation_format_func = archiver_rotation_format_func;
redef LogAscii::enable_leftover_log_rotation = T; redef LogAscii::enable_leftover_log_rotation = T;