Hi Chamila, As Manula mentioned there is a regex for identification. You can just play around by setting hostname as something like "mysql.php" to see what happens.
To get more control this can be also done by adding a facter with service type and configuring puppet master to read service type from that facter. @Manula do you have any opinion on this ? Touched, not typed. Erroneous words are a feature, not a typo.