WaterByWind / grafana-dashboards

Grafana Dashboards
MIT License
292 stars 54 forks source link

Use regex notation for $host var in WHERE clause #2

Closed chimo closed 7 years ago

chimo commented 7 years ago

Assuming $host is something like "192.168.2.43".

When using WHERE \"agent_host\" = '$host', the clause becomes WHERE "agent_host" = '192\.168\.2\.43' after interpolation.

This causes parsing errors in the templating engine: "error parsing query: found ., expected identifier, string, number, bool"

Changing the clause to WHERE \"agent_host\" =~ /^$host/ fixes that issue.

WaterByWind commented 7 years ago

Thanks! I had just noticed the oversight this morning and was confirming the change resolved the issue.