Hello,
I noticed different behavior for escaping special characters in query text mode and graphical mode.
If i have a variable defined in query editor, special characters are sanitized correctly. But after switching to text mode editor, special characters from variable like dots and slash are not sanitized.
Grafana version: 5.4.0
InfluxDB: 1.5
Tested also on Grafana 6, where the behavior was same.
tloz123
February 11, 2019, 4:38pm
2
I am getting the same issue too. I’ve posted my situation to the devs at:
opened 03:06PM - 11 Feb 19 UTC
closed 04:38PM - 11 Feb 19 UTC
Read before posting:
- Questions should be posted to https://community.grafa… na.com. Please search there and here on GitHub for similar issues before creating a new issue.
- Checkout FAQ: https://community.grafana.com/c/howto/faq
- Checkout How to troubleshoot metric query issues: https://community.grafana.com/t/how-to-troubleshoot-metric-query-issues/50
Please include this information:
### What Grafana version are you using?
Grafana v5.2.3
### What datasource are you using?
Influx
### What OS are you running grafana on?
Centos
### What did you do?
Added a variable to get away from hardcoded values in my current query.
### What was the expected result?
The graph would display the results as usual.
### What happened instead?
The graph does not display any results. It says `No data points found.`.
This was my query whilst it was hardcoded which works(query inspector):
`"SELECT non_negative_difference(max("ltmVirtualServStatClientBytesOut")) FROM "f5_serverstats" WHERE ("ltmVirtualServStatName" =~ /hosty.com/ AND "environment" =~ /^prod2$/) AND time >= now() - 6h GROUP BY time(30s) fill(null)"
`
I then created a variable of type custom and added the value `hosty.com` to the variable. Upon looking at the query inspector then, this is what came out:
`"SELECT non_negative_difference(max("ltmVirtualServStatClientBytesOut")) FROM "f5_serverstats" WHERE ("ltmVirtualServStatName" =~ /^hosty\.com$/ AND "environment" =~ /^prod2$/) AND time >= now() - 6h GROUP BY time(30s) fill(null)"
`
I don't know if its normal but there seems to be a \ before the `.com`. Even when I omit the `.com` in the variable value and simply write `hosty`, it still doesn't print out and this is what comes in the query inspector:
`"SELECT non_negative_difference(max("ltmVirtualServStatClientBytesOut")) FROM "f5_serverstats" WHERE ("ltmVirtualServStatName" =~ /^hosty$/ AND "environment" =~ /^prod2$/) AND time >= now() - 6h GROUP BY time(30s) fill(null)"`.
### If related to metric query / data viz:
### Include raw network request & response: get by opening Chrome Dev Tools (F12, Ctrl+Shift+I on windows, Cmd+Opt+I on Mac), go the network tab.