Articles → AWS → Create A Report Of Those Users Who Have Logged In To The AWS Console Today

Create A Report Of Those Users Who Have Logged In To The AWS Console Today






Steps




  1. Create a cloud trail
  2. Create a table in Athena for CloudTrail
  3. Create a query in Athena



Create A CloudTrail




Picture showing the S3 bucket created on the cloudtrail creation
Click to Enlarge


Create A Table In Athena For CloudTrail




Picture showing the Create Athena table button for creating a new table in Athena
Click to Enlarge



Picture showing the Create table query of the Athena table to be created
Click to Enlarge




Create A Query In Athena




Picture showing changing the location of query result to the cloudtrail S3 bucket
Click to Enlarge



select from_iso8601_date(substr(eventtime,1,10)), *
from cloudtrail_logs_aws_cloudtrail_logs_462618770999_54460e6c
where 
date_diff('Day',from_iso8601_date(substr(eventtime,1,10)),CURRENT_DATE) = 0
and 
eventname = 'ConsoleLogin'




Picture showing the report of those users who have logged in to the AWS console today
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Thursday, November 25, 2021

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250