I am using Grafana 6.2.1 . In variables for templating feature , I need to add regex query, to extract number :
I have below result from prometheus datasource :
instance=hostname1, topic=“AB_CD_EF_12345_ZY_XW_001_000001”
instance=hostname2, topic=“AB_CD_EF_1345_ZY_XW_001_00001”
instance=hostname1, topic=“AB_CD_EF_1235_ZY_XW_001_000001”
instance=hostname2, topic=“AB_CD_EF_GH_4567_ZY_XW_01_000001”
instance=hostname1, topic=“AB_CD_EF_35678_ZY_XW_001_00001”
instance=hostname2, topic=“AB_CD_EF_56789_ZY_XW_001_000001”
I tried with below details, they work good as a separate query :
/.topic="AB_CD_EF_([^_]+)./
12345
1345
1235
/.topic="AB_CD_EF_GH_([^_]+)./
4567
35678
56789
I need a regex which can give me out as :
12345
1345
1235
4567
35678
56789
Please help , thanks