I am using a MySQL datasource, I have a template variable, and in the query I want to use the template variable in a WHERE clause with the LIKE operator.
WHERE Summary LIKE %$variable%
But this doesn’t work, the resulting SQL is:
WHERE Summary LIKE %"variable"%
I can work around it crudely by adding the % to the custom variables, so instead of say “server1” I put “%server1%”. Is there any better way to deal with this? The problem seems to be that Grafana automatically adds the quotes around the variable but only the variable. It would be nice is there was maybe an escape character that told Grafana not to automatically add quotes.