diff --git a/BroControl/cron.py b/BroControl/cron.py index e9701218..6c452da6 100644 --- a/BroControl/cron.py +++ b/BroControl/cron.py @@ -6,6 +6,7 @@ from BroControl import execute from BroControl import py3bro +from BroControl import node as node_mod class CronUI: def __init__(self): @@ -121,10 +122,26 @@ def expire_logs(self): if self.config.logexpireminutes == 0 and self.config.statslogexpireinterval == 0: return - success, output = execute.run_localcmd(os.path.join(self.config.scriptsdir, "expire-logs")) + if self.config.standalone: + success, output = execute.run_localcmd(os.path.join(self.config.scriptsdir, "expire-logs")) + + if not success: + self.ui.error("expire-logs failed\n%s" % output) + else: + nodes = self.config.hosts(tag=node_mod.logger_group()) + + if not nodes: + nodes = self.config.hosts(tag=node_mod.manager_group()) + + expirelogs = os.path.join(self.config.scriptsdir, "expire-logs") + cmds = [(node, expirelogs, []) for node in nodes] + + for (node, success, output) in self.executor.run_cmds(cmds): + if not success: + self.ui.error("expire-logs failed for node %s\n" % node) + if output: + self.ui.error(output) - if not success: - self.ui.error("expire-logs failed\n%s" % output) def expire_crash(self): if self.config.crashexpireinterval == 0: diff --git a/CHANGES b/CHANGES index 7ca8f3a6..719d5a7e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ +1.9-11 | 2019-01-04 13:10:54 -0600 + + * Adding support for log rotation/expiration for distributed loggers. (Stefan Maerz) + 1.9-8 | 2018-12-10 15:07:31 -0600 * Change Travis btest commnad to help isolate hung tests (Jon Siwek, Corelight) diff --git a/VERSION b/VERSION index 64932f00..ee4d083a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.9-8 +1.9-11 diff --git a/doc/main.rst b/doc/main.rst index 02ad225c..3eb36bac 100644 --- a/doc/main.rst +++ b/doc/main.rst @@ -3,7 +3,7 @@ .. Note: This file includes further autogenerated ones. .. .. Version number is filled in automatically. -.. |version| replace:: 1.9-8 +.. |version| replace:: 1.9-11 ========== BroControl