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
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
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.