Community discussions

MikroTik App
 
filipebezerra
just joined
Topic Author
Posts: 2
Joined: Sat Sep 30, 2023 2:21 pm
Location: Paracuru/CE - Brazil

Function Find Log doesn't work properly on v7.x

Sat Sep 30, 2023 3:34 pm

I'm making a script to find for a specific log line. I use this line on version 6.48 and works fine, but the same command on version 7.10 returns all logs, not only the last five minutes.
/log find where time > ([/system clock get time] - 5m) message~"blocktv"
Any clue?
 
filipebezerra
just joined
Topic Author
Posts: 2
Joined: Sat Sep 30, 2023 2:21 pm
Location: Paracuru/CE - Brazil

Re: Function Find Log doesn't work properly on v7.x  [SOLVED]

Sat Sep 30, 2023 5:47 pm

Ok, for anyone who's having the same trouble, just use:
/log/find where time > ([/system/clock/get time] - 5m) message~"blocktv"
Worked for me.
 
nediis
Frequent Visitor
Frequent Visitor
Posts: 63
Joined: Wed Jul 11, 2018 10:32 am

Re: Function Find Log doesn't work properly on v7.x

Mon Oct 02, 2023 11:56 am

/log find where time > ([/system clock get time] - 5m) message~"blocktv"
in version 7.11.2 it works correctly
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12014
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Function Find Log doesn't work properly on v7.x

Mon Oct 02, 2023 12:04 pm

If you try the script around midnight it doesn't work...

For example, if the clock is 00:02:00, subtracting 5 minutes gives -00:03:00 and "-3 minutes" does not exist in the log...

Removing or adding the "/" had no effect, it's just that time has passed...

The approach is totally wrong and ridiculous, without thinking about the fact that in the logs there are 4 different types of dates, some without even the time.
It would be enough to read what already exists on the forum without having to rewrite the same bulls–t all over again.

Who is online

Users browsing this forum: No registered users and 10 guests