Tuesday, November 2, 2021

script to Showing successfully authenticated users with the number of successful authentications in aws redshift Database?

 script to Showing successfully authenticated users with the number of successful authentications:


SELECT username, event, COUNT(*)

FROM stl_connection_log

WHERE event = 'authenticated'

GROUP BY 1, 2

ORDER BY 3 DESC;


                      username                      |                       event                        | count

----------------------------------------------------+----------------------------------------------------+-------

 rdsdb                                              | authenticated                                      |  4927

 IAM:test2@us.domain.com                            | authenticated                                      |  1833

 test3                                              | authenticated                                      |   720

 IAMA:test1@us.domain.com                           | authenticated                                      |   344

 IAMA:xyz.123@domain.com                            | authenticated                                      |    65

No comments:

Post a Comment