How can I see the stats about queries similar to what one can see in the queries tab within the aws console at the cluster panel but using a shell based tool like aws-cli?
2 Answers
The information about queries executed in Amazon Redshift are stored in System Tables.
See: STL Tables for Logging - Amazon Redshift
It is not possible to access this information via the AWS Command-Line Interface (CLI). You will need to use an SQL client (eg psql) to connect to Redshift to be able to query these tables.
Comments
Although some answers were really close, the queries that appear in the queries tab in the redshift console is at pg_catalog.stv_recents. Having psql installed, one can query that by executing:
psql $connection_string \
--command="select * from pg_catalog.stv_recents order by starttime desc;"
1 Comment
WEBjuju
this table seems to only have about 5 seconds worth of data in it