A friend of mine @VICTOR GALVAO used your approach and modified a little bit: 

Using the parameters "1,8,3,2" you can get SERVER:INSTANCE:NAMESPACE>