Scripts to automatically remove active name when its profile is change.

Does anyone has a script to remove active name if the profile in secrets is change based on logs. i want to capture the “test” name in log below

message pppoe server changed by admin: ppp secret changed by admin


:local pppusername [/log find message=$user]
/ppp active remove [find name=$pppusername]