It shows in the user manual that you can use
:log info "User $user logged in!"
This send the user logging into the log. My question is there also a way to logging the user's MAC as well in this script?
0 name="douser" owner="admin" policy=read,write,policy,test,password,sniff,sensitive last-started=may/09/2012 12:04:07 run-count=50 source=
{
:log info "User $user logged in!"
}
0 name="douser" owner="admin" policy=read,write,policy,test,password,sniff,sensitive last-started=may/09/2012 12:04:07 run-count=50 source= :log info "User $user logged in!"
try this:My question is there also a way to logging the user's MAC as well in this script?
:local "hotspot_user" $user; :log info "User $user with mac-address of $[/ip hotspot active get [find user=$"hotspot_user"] mac-address] logged in!"
$user is a local variable, it will not work if you call it from another script. it should be directly used in on-login and on-logout section.none of the above work they all error on the $user variable.
:log info "User $user logged in!"
:local "hotspot_user" $user;
:log info "User $user with mac-address of $[/ip hotspot active get [find user=$"hotspot_user"] mac-address] logged in!"
{
:log info "User $user logged in!"
}
You got it all wrong. you can only use $user in on-login and on-logout section. not from command line and not from another script.I tried the following (executing them from command line does not work I accept the reason for that is $user is only defined during the on-login process).