title: Regex: Grafana Variables convert hyphen separated IPs to Dot separated IPs
body: <p>I am trying to created a variable in Grafana using a custom query to scan the nodes in EKS cluster. Currently the node variable is stored as "hyphen" separated strings (ex. 10-109-22-102); i intend it to be reported as "dot" separated strings (ex. 10.109.22.102). Is this even possible by regex?</p>
  
  <p>Grafana <a href="https://grafana.com/docs/reference/templating/#variables" rel="nofollow noreferrer">variables</a> support creating of live variables by scraping a given metric and then extracting a value in the reported metric using regex. I am currently scraping a metric:</p>
  
  <blockquote>
    <p>kube_node_info{container_runtime_version="docker://18.6.1",endpoint="http",instance="10.11.111.111:8080",job="kube-state-metrics",kernel_version="xxxxx",kubelet_version="xxxx",kubeproxy_version="xxxx",namespace="infra",node="ip-10-11-111-111.us-sdlls-as.compute.internal",os_image="Amazon
    Linux
    2",pod="prometheus-operator-kube-state-metrics-sdfgsjdkgl-saldjl",service="prometheus-operator-kube-state-metrics"}</p>
  </blockquote>
  
  <p>I am currently using regex: <code>/.*node="ip-([^"]*).us-*/</code> to extract the "hyphen" separated IPs. I have also tried using other match groups ex: <code>([\d]{2,3})-([\d]{2,3})-([\d]{2,3})-([\d]{2,3})</code> however this returns only first match-group in grafana (in this case <code>10</code>) as the only option.</p>
  
  <p>Expected output should be:</p>
  
  <pre><code>10.11.111.111
  </code></pre>