REFERENCE

v6.11.0

Logging Config

Logging rules + actions: where each topic is logged (`/system logging`).

Tools

add_logging_rule

Add System Logging Rule · Risk: write

Creates a system logging rule (/system logging add) that routes log messages matching specified topics to a named logging action — defines WHICH topics go WHERE. The topics field accepts comma-separated RouterOS topic strings (e.g. "info", "firewall,!debug"). The referenced action must already exist; to define a physical log destination (memory, disk, remote syslog, email, echo) use add_logging_action. To inspect existing rules use list_logging_rules. Returns the created rule's detail.

ParameterRequiredDefinition
topicsYesComma-separated log topics, e.g. "info", "firewall,!debug" {"type":"string"}
actionNoLogging action name (default 'memory') {"type":"string"}
prefixNoText prepended to each matching log message {"type":"string"}
disabledYes{"default":false,"type":"boolean"}

list_logging_rules

List System Logging Rules · Risk: read

Lists system logging rules (/system logging print), optionally filtered by partial topics match or exact action name. Returns the topic-to-action routing table — each rule shows which log topics are forwarded to which named action. To see what each action does (its physical destination) use list_logging_actions. Returns matching rules or a 'no rules found' message.

ParameterRequiredDefinition
topics_filterNoPartial topics match {"type":"string"}
action_filterNoExact action name {"type":"string"}

remove_logging_rule

Remove System Logging Rule · Risk: destructive

Permanently removes a system logging rule (/system logging remove) by its .id — stops the matched topics from being routed to that action. Confirms the rule exists before deleting. rule_id is the .id value returned by list_logging_rules (e.g. '*1'). To remove a logging action (physical destination) instead use remove_logging_action.

ParameterRequiredDefinition
rule_idYesInternal .id of the logging rule, e.g. '*1' {"type":"string"}

add_logging_action

Add System Logging Action · Risk: write

Creates a system logging action (/system logging action add) defining a physical log destination — the named target referenced by logging rules. target selects the destination type: memory (in-RAM buffer), disk (file), echo (terminal), remote (UDP syslog server), or email. Target-specific parameters: remote/remote_port/bsd_syslog/syslog_facility/syslog_severity for remote syslog; disk_file_name/disk_lines_per_file for disk; memory_lines for memory; email_to for email. Once created, reference this action by name in add_logging_rule. To list existing actions use list_logging_actions. Returns the created action's detail.

ParameterRequiredDefinition
nameYesName for the new logging action {"type":"string"}
targetYesWhere log messages are written {"type":"string","enum":["memory","disk","echo","remote","email"]}
remoteNoRemote syslog server address (target=remote) {"type":"string"}
remote_portNoRemote syslog UDP port {"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
src_addressNoSource address used when sending to remote syslog (target=remote) {"type":"string"}
bsd_syslogNoUse BSD-style syslog format {"type":"boolean"}
syslog_facilityNo{"type":"string"}
syslog_severityNo{"type":"string"}
syslog_time_formatNoSyslog timestamp format, e.g. 'bsd' or 'iso8601' {"type":"string"}
disk_file_nameNoFile name for target=disk {"type":"string"}
disk_lines_per_fileNo{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
disk_file_countNoNumber of files used to store log (target=disk) {"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
disk_stop_on_fullNoStop saving once disk-lines-per-file is reached (target=disk) {"type":"boolean"}
memory_linesNoLines kept for target=memory {"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
memory_stop_on_fullNoStop saving once memory-lines is reached (target=memory) {"type":"boolean"}
rememberNoKeep messages not yet displayed in console (target=memory) {"type":"boolean"}
email_toNoRecipient address for target=email {"type":"string"}
disabledYes{"default":false,"type":"boolean"}

list_logging_actions

List System Logging Actions · Risk: read

Lists system logging actions (/system logging action print), optionally filtered by partial name match. Returns the named destinations available for use in logging rules — each entry shows target type (memory, disk, echo, remote, email) and its configuration. To see the topic-routing rules that reference these actions use list_logging_rules. Returns matching actions or a 'no actions found' message.

ParameterRequiredDefinition
name_filterNoPartial name match {"type":"string"}

remove_logging_action

Remove System Logging Action · Risk: destructive

Permanently removes a system logging action (/system logging action remove) by its name — deletes the physical log destination definition. Confirms the action exists before deleting. name is the action name from list_logging_actions. Warning: removing an action still referenced by active logging rules leaves those rules with an invalid target — remove or update dependent rules first using remove_logging_rule. To remove a logging rule (topic filter) instead use remove_logging_rule.

ParameterRequiredDefinition
nameYesName of the logging action to remove {"type":"string"}

On this page