Nested command problem

Hi,

When at the command prompt I type in

:log info [/ip address get 0 address]

and a log entry with the ip address of item 0 appears in the log as I wish.

But when I create a scheduled task to do this every 5 minutes, it does not work. I get an empty log entry. From what I can tell, it is not executing the nested get command. Please help with the proper syntax.

/system scheduler add name=checking-in interval=5m on-event={:log info [/ip address get 0 address]} disabled=no

You cannot use the “0” to identify the entry you want. This only works on the console, if you have done a “print” of these values before.

In scripts you have to use the find command. What you “find” for depends on your application. I suppose you would like to get the ip address of an interface. This could be something like

:log info [/ip address get [/ip address find interface=pppoe-out1] address]

to log the ip address of interface “pppoe-out1”.

Best regards,
Christian Meis

That makes sense. Thank you.