Kibana SQL does not support sub-selects like the one you're showing, and Elasticsearch does not support joins across indices. You can use the aggregations in Elasticsearch to do very powerful grouping like you've shown, but all the relevant data needs to be part of the same document. This is the standard way that a document store like Elasticsearch needs denormalized data.
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.