Try something like this (sample tstats command, replace it with your own). The case statement works with regular expression and providing a partial regex will match any position.
| tstats count WHERE index=* by host | eval Environment=case(match(host,"x80"),"env1",match(host,"y20"),"prod",match(host,"L"),"test","ny","someotherenv",ture(),"OTHERE") | stats sum(count) as count by Environment
ah the page does not like the wild cards. common is the ny between the wildcards * ny *
page keeps cutting my post, but i hope it makes sense..