Other Scripts
Clear System Logs (Memory) — v6 & v7
Clears the in-memory log by shrinking the memory log buffer to one line and then restoring it to your normal size.
RouterOS v6 & v7
# EN: Number of log lines to keep normally, as a number (RouterOS default is 1000)
# AR: عدد أسطر السجل الطبيعي كرقم (القيمة الافتراضية في RouterOS هي 1000)
:local normalLines "change here";
# EN: Safety check - prevents leaving the log at 1 line | AR: حماية - تمنع ترك السجل بسطر واحد
:if ([:typeof $normalLines] != "num") do={ :error "Edit the variable first" }
# EN: Shrink the buffer to 1 line (this clears the log) | AR: تصغير المخزن إلى سطر واحد (يمسح السجل)
/system logging action set memory memory-lines=1
:delay 1s
# EN: Restore the normal size | AR: إعادة الحجم الطبيعي
/system logging action set memory memory-lines=$normalLines