Community discussions

MikroTik App
 
bara
just joined
Topic Author
Posts: 1
Joined: Wed Jan 22, 2025 6:00 am

How to filter logging time 24 hours ago and topics=ppp and message=connected in log.0.txt

Wed Jan 22, 2025 6:05 am

halo
can help me.
i stuck to find script filter logging time 24 hours ago and topics=ppp and message=connected and save become new file txt
this is script i created and running but just can filter topics ppp and message connected
:local fileconten [/file/get ppp_log.0.txt contents]

:local scriptfilter [/log print file=ppp_connected_logs.txt where topics~"ppp" and  message~"connected"]
{
 :foreach Log in=$fileconten do={[$scriptfilter]
}
}
Thank You
Last edited by tangent on Wed Jan 22, 2025 6:45 am, edited 1 time in total.
Reason: wrapped script in "code" block
 
ConnyMercier
Forum Veteran
Forum Veteran
Posts: 777
Joined: Tue Dec 17, 2019 1:08 pm

Re: How to filter logging time 24 hours ago and topics=ppp and message=connected in log.0.txt

Wed Jan 22, 2025 5:33 pm

Do you really need the "24 Hours" ??

I am asking, because that is relatively complex to execute....

Alternatively, it could be quite easy to write a script that exports the Log entries of the DAY.
In other words, a script that exports the Logs of the "Today 22.01.2025" instead of the "24 Hours"