Logging variables ?

Hi,
I’m trying to log ARP changes for a specific ip-address but for some reason I can’t get :log to accept my variables.
I do the following

:global BFARP [/ip arp get [/ip arp find address=1.1.1.1] mac-address ]
:do [/ip arp remove [/ip arp find address=1.1.1.1] ]
:global AFARP [/ip arp get [/ip arp find address=1.1.1.1] mac-address ]
:do [:log info "Arp changed from $BFARP to $AFARP" ]
:global BFARP
:global AFARP

(ps. 1.1.1.1 is ofcourse fictive and is not the real value :stuck_out_tongue:)

but it doesn’t work - I get no result in the log at all.
If I do the same on the console I get invalid argument name

It seems to work when I use only one variable .. like

:do [:log info "$BFARP"]

Any ideas of this can be done ?

try for each instead of do.

Sam

You can also changed your log input to look like this

:log info ("Arp changed from " . $BFARP . " to " . $AFARP)

Yea that worked like a charm :slight_smile:
Thanks! :slight_smile: