I’m trying to get ad-hoc filters working in Grafana with Loki data source. Everything says it would work fine, however when I try to implement a filter, every query returns the same error immediately.
parse error at line 1, col 90: syntax error: unexpected {
Object
status:400
statusText:“Bad Request”
data:Object
message:“parse error at line 1, col 90: syntax error: unexpected {”
error:“Bad Request”
response:“parse error at line 1, col 90: syntax error: unexpected {”
config:Object
url:“api/datasources/proxy/5/loki/api/v1/query_range?direction=BACKWARD&limit=1213&query=sum(count_over_time(%7Bdomain%3D%22domainname.com%22%2Chost%3D%22subdomain.domainname.com%22%7D%20%7C%20json%7Bhost%3D%22subdomain.domainname.com%22%7D%20%7C%20url!~%22.*(ico%7Bhost%3D%22subdomain.domainname.com%22%7D%7Cjs%7Bhost%3D%22subdomain.domainname.com%22%7D%7Cjpg%7Bhost%3D%22subdomain.domainname.com%22%7D%7Cjpeg%7Bhost%3D%22subdomain.domainname.com%22%7D%7Cpng%7Bhost%3D%22subdomain.domainname.com%22%7D%7Cwebp%7Bhost%3D%22subdomain.domainname.com%22%7D%7Ccss%7Bhost%3D%22subdomain.domainname.com%22%7D%7Cwebmanifest%7Bhost%3D%22subdomain.domainname.com%22%7D)%22%5B1s%5D))&start=1628946873735000000&end=1628948673736000000&step=1”
hideFromInspector:false
message:“parse error at line 1, col 90: syntax error: unexpected {”
This is the query URL without the ad-hoc filter:
url:“api/datasources/proxy/5/loki/api/v1/query_range?direction=BACKWARD&limit=1213&query=sum(count_over_time(%7Bdomain%3D%22domainname.com%22%7D%20%7C%20json%20%7C%20url!~%22.*(ico%7Cjs%7Cjpg%7Cjpeg%7Cpng%7Cwebp%7Ccss%7Cwebmanifest)%22%5B1s%5D))&start=1628947413854000000&end=1628949213854000000&step=1”
Any ideas?