security_events
Retrieve filtered RouterOS log entries for login, logout, authentication failures, critical errors, and system info access events so you can correlate anomalies without scanning the full log.
Instructions
Recent RouterOS log entries filtered down to security-relevant
ones - login/logout/authentication-failure events (topic
"account"), "critical"/"error" topic entries, and generic
"system,info" rows whose message looks like a login/logout - so a
caller can correlate access attempts/anomalies without reading the
entire (often much larger) unfiltered log via logs.
Filtering happens in Python, same reasoning logs' topics filter
already documents (RouterOS's structured API doesn't expose a
query-by-field read here either) - and is applied BEFORE the
limit cut, so this returns the most recent limit MATCHING
entries (not the last limit raw entries filtered afterward, which
would silently drop matches on a busy log).
limit must be positive and is capped at 500 (default 50), the same
shape as logs' own limit.
READ-ONLY: not gated by MIKROTIK_ALLOW_WRITE.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| device_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |