Lookup table or similar - translate string to number

Hi all,
we’re using director import to create our hosts with a lot of custom varibables.
Now I want to setup an http monitor which a specific port (-p XXXX) based on the hosts stage. I have the stage as custom variables like “production” or “testing”. And I need something like:
Production = 0
Testing = 1
Development = 2

Is this somehow possible? I dont want to create a ServiceSet for each Stage. I thought its maybe possible to setup one apply rule and the port is a variable which looks up the stage and translates to the port number.
Maybe you have an idea.


okay I could use the “map” function from director and create a new custom variable. But I thought, that I could avoid creating a new custom variable.


another possibility would be to save this with the host vars. In the service definition you yould access to this var. We are doing this very often