Using urlparam in an Elasticsearch SQL query in Kibana Canvas

How would I use the value received from a urlparam in an Elasticsearch SQL query?

For example:
I need to use the urlparam in an Elasticsearch SQL query which is used to retrieve data used to populate a datatable so I would like something like this:
filters
| essql
query="SELECT project, release, sum(effort) FROM my_index where field= "{urlparam param=varFromURL default=1000} " group by field1, field2"
| table
| render

Apologies for the slightly messy question. Sort of in a rush. Thanks

Hey @Sahiru_Gunawardene, welcome to the discussion boards!

Give this syntax a try. I do want to caution you though -- this is widely considered unsafe, as you are taking data from the URL (which the user controls) and injecting it into a SQL query:

filters
| essql
query={string "SELECT project, release, sum(effort) FROM my_index where field= '" {urlparam param=varFromURL default=1000} "' group by field1, field2"
| table
| render

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.