title: aliasSub Graphite function help in Grafana
body: <p>I am struggling with formatting some Graphite metrics using the <a href="https://graphite.readthedocs.io/en/latest/functions.html#graphite.render.functions.aliasSub" rel="nofollow noreferrer">aliasSub</a> function and regular expressions within a Grafana query.</p>
  <p>The defined Series gives the metric a string of <code>icinga2.Customer_websites_(SIT).services.my_domain_co_uk.http.perfdata.time.value</code></p>
  <p>By trial and error, I have successfully edited this using the <a href="https://graphite.readthedocs.io/en/latest/functions.html#graphite.render.functions.aliasSub" rel="nofollow noreferrer">aliasSub</a> function to rename the metric to <code>my_domain_co_uk</code> using:</p>
  <pre><code>aliasSub(^(.*)\.Customer_websites_\(SIT\)\.services\.(.*)\.http.perfdata.time.value,\2)
  </code></pre>
  <p>How do I now use a nested aliasSub function and regular expressions to replace the <code>_</code> with <code>.</code> so that I end up with <code>my.domain.co.uk</code>?</p>