Hi,
The queries can be collected through the Cloudera Manager API, as CM automatically collects Impala queries, this way there is no need to visit every Coordinator node one by one. The usage can be found in the Cloudera Manager API documentation, while further endpoints can be found here.
I believe one of the endpoints you are looking for is impalaQueries:
/clusters/{clusterName}/services/{serviceName}/impalaQueries