Label substring as legend

I have a Prometheus timeseries, it has a label “host”. So I can use {{host}} as legend and get its values like:
com.acme.www
com.acme.mail
com.acme.ftp

Is there a way to specify the legend so that it only displays the last substring:
www
mail
ftp

I’m using version 10.4.5.

Use Rename by regex transformation:

Wow, that’s exactly what I needed. Thanks ebabeshko !