eworm-de / routeros-scripts

a collection of scripts for MikroTik RouterOS
GNU General Public License v3.0
1.27k stars 285 forks source link

log-forwarding: non expected messages are still forwarded #55

Closed bubenkoff closed 8 months ago

bubenkoff commented 8 months ago

I have only those settings in the config:

:global LogForwardIncludeMessage "(olha)";

But still get such messages forwarded for some reason:

The log on LTE contains these 2 messages after 2d18:32:21 uptime.

🔴️ 06:50:44 ipsec;error phase1 negotiation failed due to time up 33[500]<=>33[37672] d8757bb7945e3880:f23e9a07bac4fbdc
🔴️ 06:50:45 ipsec;error phase1 negotiation failed due to time up 33[500]<=>323[14651] 1a32d74bb499f6f1:e997e28f4652eccf

The expected messages are also passed, but just some additional non-expected messages also do pass. Can you please help me understand what I missed in the configuration, or is it a bug?

eworm-de commented 8 months ago

I guess you have the default for LogForwardFilter?

:global LogForwardFilter "(debug|info|packet|raw)";

If you do not want to receive all warnings and errors add these to the filter, like:

:global LogForwardFilter "(debug|info|warning|error|packet|raw)";

Alternatively setting an empty strings should filter everything:

:global LogForwardFilter "";

The idea is to have a basic set of filters (LogForwardFilter & LogForwardFilterMessage), these drop the messages you do not want. The default is to drop messages with topics debug, info, packet & raw. This mostly keeps warnings and errors to be forwarded, and that's what you see as unexpected messages.

After that you can define messages (with LogForwardInclude & LogForwardInclude) that should be forwarded anyway, even if filtered before.

bubenkoff commented 8 months ago

Thank you for your help!