mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-03 01:34:32 +02:00
log-forward: use colorful bullets to indicate severity
This commit is contained in:
parent
ef3b8f8ddd
commit
24823441c3
3 changed files with 12 additions and 4 deletions
|
@ -17,7 +17,6 @@
|
|||
:global LogForwardIncludeMessage;
|
||||
:global LogForwardLast;
|
||||
:global LogForwardRateLimit;
|
||||
:global NotificationsWithSymbols;
|
||||
|
||||
:global EitherOr;
|
||||
:global HexToNum;
|
||||
|
@ -53,14 +52,19 @@ $ScriptLock $0;
|
|||
!(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \
|
||||
topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={
|
||||
:set MessageVal [ /log/get $Message ];
|
||||
:local Bullet "information";
|
||||
|
||||
:if ($Last < [ $HexToNum ($MessageVal->".id") ]) do={
|
||||
:local DupCount ($MessageDups->($MessageVal->"message"));
|
||||
:if ($MessageVal->"topics" ~ "(emergency|alert|critical|error|warning)") do={
|
||||
:if ($MessageVal->"topics" ~ "(warning)") do={
|
||||
:set Warning true;
|
||||
:set Bullet "large-orange-circle";
|
||||
}
|
||||
:if ($MessageVal->"topics" ~ "(emergency|alert|critical|error)") do={
|
||||
:set Bullet "large-red-circle";
|
||||
}
|
||||
:if ($DupCount < 3) do={
|
||||
:set Messages ($Messages . "\n" . [ $IfThenElse ($NotificationsWithSymbols = true) (" \E2\97\8F ") ] . \
|
||||
:set Messages ($Messages . "\n" . [ $SymbolForNotification $Bullet ] . \
|
||||
$MessageVal->"time" . " " . [ :tostr ($MessageVal->"topics") ] . " " . $MessageVal->"message");
|
||||
} else={
|
||||
:set Duplicates true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue