What is the replacement of SQL UNION in KQL?

Hi Team,

Would like to check in this forum, Is there anyway that we can achieve UNION by using KQL?
I have a requirement where I would need to build a Kibana dashboard with UNION of multiple sub-queries.

Thank you!

I don't think KQL is the right answer here - it's a rough comparison, but it's basically just the WHERE part of a SQL query (The concepts of SELECT, GROUP BY and so on are managed by the individual visualizations).

Can you explain what you want to do exactly?

There is no support for UNION or UNION ALL in ES-SQL at the moment.
The only workaround is to query multiple indices with a pattern, e.g.:

SELECT * FROM "idx-*" WHERE ...

But this means that you have indices with compatible fields (same name and compatible data types), and that you apply the exact same WHERE clause, ORDER BY, etc. There is currently no support of UNIONing subqueries.