Hi, > key = User-Name <---- use the if { your patch} ??? either change this to Stripped-User-Name instead....or if you ONLY want this to be the full realm when its NOT the realm of interest, then create a new SQL query and then wrap unlang around it eg if ("%{User-Name}" =~ /\@realm.you.want$/i ){ monthlycounter1 } else { monthlycounter2 } alan