#Display substring of value

1 messages · Page 1 of 1 (latest)

summer arrow
#

Hi all, Does anyone know how to extract the substring from a value in Grafana? For example with the nodel_lables you can show the version of ONTAP but this is looks like NetApp Release 9.13.1P10: Wed Jun 19 12:23:45 UTC 2024
and I would prefer only 9.13.1P10 or NetApp Release 9.13.1P10

green onyx
#

See if below works as a prometheus query?

label_replace(node_labels, "extracted_version", "$1", "version", ".*([0-9]+\\.[0-9]+\\.[0-9]+[A-Za-z0-9]*).*")
summer arrow
#

hmm still looks the same. I'm currently to create a overview dashboard where we see the amount of systems per version with the query sum(netapp_node_labels{datacenter=~"$Datacenter",cluster=~"$Cluster"}) by (version)

green onyx
#

Query I gave above creates a new label extracted_version as below