Community discussions

 
man
newbie
Topic Author
Posts: 46
Joined: Tue Jul 25, 2017 2:58 pm

[SOLVED] BUG (??) /log print where topics=info && message=$message

Tue Oct 23, 2018 5:43 pm

During the executing on the code below, i get all "downloaded" files which are catched at the logger.
{
  :local message "fetch: file \"flash/home/test.txt\" downloaded";  
  /log print  where topics=info && message=$message 
}
Output:
  • 17:19:55 info fetch: file "flash/test/tf_1.txt" downloaded
    17:20:02 info fetch: file "flash/test/tf_2.txt" downloaded
    17:20:06 info fetch: file "flash/test2/ico.png" downloaded

But the by path flash/home/test.txt has not been downloaded at all.
Last edited by man on Tue Oct 23, 2018 6:05 pm, edited 1 time in total.
 
man
newbie
Topic Author
Posts: 46
Joined: Tue Jul 25, 2017 2:58 pm

Re: BUG (??) /log print where topics=info && message=$message

Tue Oct 23, 2018 6:02 pm

Ok i see.
The variable should not be named = message
here:
/log print  where topics=info && message=$message
If we do like that:
/log print  where topics=info && message=$ms
then all works like it should.
 
User avatar
strods
MikroTik Support
MikroTik Support
Posts: 1407
Joined: Wed Jul 16, 2014 7:22 am
Location: Riga, Latvia

Re: [SOLVED] BUG (??) /log print where topics=info && message=$message

Tue Oct 23, 2018 9:31 pm

That is correct. You should never use variable names in RouterOS that are equal with some command or parameter name.

Who is online

Users browsing this forum: No registered users and 1 guest