Get the SQL port number in variable for rule

I want to get the connection string of SQL Server in rule by defining it in variable .

I can get host name by using variable expression scope.get("host").get("name").

But i want to know the way to get port number or complete connection string. I want it so i can connect to that instance and run some script or queries.