Kibana essql - select from select

I know that it is limitation in regular SQL in Kibana, but ESSQL is more like script than single query, so:

Is it possible in ESSQL to use select from select?.

For example, saving result from first select as table into variable "my_query":

|var_set name=my_query value={essql query={string SELECT host.name as n, system.diskio.name as s, last(system.diskio.io.time,\"@timestamp\") as v FROM \"<metricbeat-7.11.1-{now/d}>\" 
where n is not null and s is not null group by n, s order by v desc}}

and now I want to use this table from variable "my_query" in another select:

| essql query="SELECT xxx from my_query"

Is it possible?, if yes, please help me.

Thank You,
Pat

Hi Pat, no this is not possible at the moment, ESSQL is an Elasticsearch SQL query, the current output is not chainable into another ESSQL query at the moment.
We are working on something similar but I don't have an ETA for that feature

If not too complex, you an always use the canvas expression language to modify change the returned table, see: Canvas function reference | Kibana Guide [master] | Elastic

Thank You for Your answer. I am waiting for new features :wink:
Have a nice day.

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