grafana / grafana-zabbix

Zabbix plugin for Grafana dashboard
http://play.grafana-zabbix.org
Apache License 2.0
2.06k stars 458 forks source link

regexes with curlies stopped to work #432

Closed ignaqui closed 7 years ago

ignaqui commented 7 years ago

I'm submitting a ...

If you don't send bug report, remove sections below

For bug report please include this information:

Software Versions

Grafana Zabbix Grafana-Zabbix Plugin
4.4.1 3.2.4 3.5.1

What did you do?

Once I updated grafana and grafana-zabbix, variables in templates stopped to work. It appeared that dot separator has been phased out from data source in favor of curlies. However, I think this broke my regexes which have curlies inside.

What was the expected result?

The following query used to return proper values: /alu/./tw-(nyc|que|brx|dwt|brk)-sta_(\w|\d)*-alu-[0-9{2}/

What happened instead?

This query does not work: {alu}{/tw-(nyc|que|brx|dwt|brk)-sta_(\w|\d)*-alu-[0-9]{2}/}

and this does work: {alu}{/tw-(nyc|que|brx|dwt|brk)-sta_(\w|\d)*-alu-[0-9]*/}

I tried to mask curlies with backslash and use double curlies without success

alexanderzobnin commented 7 years ago

@ignaqui this is a great test case! I'll add it to unit tests to ensure things are working in next releases.