Skip to content

Instantly share code, notes, and snippets.

@iakov-aws
iakov-aws / qs_actions_views.sql
Last active September 5, 2025 07:48
This SQL view of AWS CloudTrail logs creates a comprehensive presentation for Amazon QuickSight Dashboard and Analysis activities of users. It extracts and standardizes key information including event timestamps, user identity details (account ID, type, ARN), session context, source IP addresses, and user agents. The view intelligently categoriz…
CREATE OR REPLACE VIEW "qs_actions_views" AS
SELECT
DATE_PARSE(eventtime, '%Y-%m-%dT%H:%i:%sZ') AS event_time,
awsregion,
eventname,
useridentity.accountid AS user_identity_account_id,
useridentity.type AS user_identity_type,
useridentity.arn AS user_identity_arn,
useridentity.sessioncontext.sessionissuer.arn AS session_issuer_arn,
sourceipaddress,