2
votes

I'm trying to use grafana's world map plugin, which requires a certain form for it's metric names: DE, FR etc.

I don't have those metrics available in my graphite data and I don't have control over it, but I do have urls available e.g. www.foo.de, www.foo.fr.

Is there a way to transform a metric name i.e take the last two characters before using it?

1
Looks like a combination of aliasSub and aliasByNode. Experimenting now.. - Dan

1 Answers

2
votes

The answer is the aliasSub function which can do a regex replace.

I used this in combination with aliasByNode to replace the parts of the url I didn't need e.g.:

aliasByNode(aliasSub(xxx.yyy.zzz.www_foo_fr.aaa.bbb, 'www_foo_', ''), 4)