quickwit-datasource icon indicating copy to clipboard operation
quickwit-datasource copied to clipboard

Wildcard in a text box escapes the wildcard

Open mzupan opened this issue 1 year ago • 3 comments

Using the plugin, if I set a textbox variable and use a wildcard like

Screenshot 2024-06-09 at 9 38 10 AM

In the query it is escaping the *. Here is the query it sent to quickwit

query:"status_code:[200 TO 499] AND endpoint:\"\\*\""

This is my query for the graph

status_code:[200 TO 499] AND endpoint:"$endpoint"

Also tried

status_code:[200 TO 499] AND endpoint:$endpoint
status_code:[200 TO 499] AND endpoint:""$endpoint

mzupan avatar Jun 09 '24 16:06 mzupan

everything is escaped when sent via query it seems.

This severely limits the use of variables as a way to drill down for search.

uptickmetachu avatar Aug 01 '24 00:08 uptickmetachu

@mzupan @uptickmetachu I think it's possible to avoid this pb. On Fly.io we have a query text box, and this works: ${query:text}

To give you the full query run on Fly: fly.app.name:${app:singlequote} fly.app.instance:${instance:singlequote} ${query:text}

Note that in the grafana plugin, the default boolean operator is AND, so in this example, quickwit will really execute fly.app.name:${app:singlequote} AND fly.app.instance:${instance:singlequote} AND ${query:text}

fmassot avatar Aug 01 '24 02:08 fmassot

Yup works for me!

I do have to use some querybuilding trickery to make it work as a field exists * when nothing is selected and as a quoted text for when a value is selected.

uptickmetachu avatar Aug 01 '24 03:08 uptickmetachu

thanks finally got around to this but ${query:text} seemed to fix the issue

mzupan avatar Oct 14 '24 21:10 mzupan