I have a question about the AWS admin console. I have it set up and working, but I noticed the query for the main dataset isn’t capturing the first and last login for users. Essentially, this query is not capturing it as intended.:
FULL JOIN (
SELECT
“username”
, “accountid”
, “min”(“eventtime”) “firstlogin”
, “max”(“eventtime”) “lastlogin”
FROM
(SELECT
“eventtime”
, “awsregion”
, “sourceipaddress”
, “concat”(“split_part”(“split_part”(“resources”[1].“arn”, ‘:’, 6), ‘/’, 2), ‘/’, “useridentity”.“username”) “username”
, “resources”[1].“accountid” “accountid”
FROM
“admin-console”.“cloudtrail_logs”
WHERE (“eventname” = ‘AssumeRoleWithSAML’)
GROUP BY 1, 2, 3, 4, 5)
GROUP BY 1, 2
) l ON ((“d”.“user_name” = “l”.“username”) AND (“d”.“accountid” = “l”.“accountid”)))
If anyone has experience with the console, I can provide more information.