ãã®ããã°ã§ã¯ãAmazon Kinesis FirehoseãAmazon AthenaãAmazon QuickSight ãªã©ã® AWS ãµãŒãã¹ã䜿çšããŠãã客æ§ã®ã¡ãŒã«é²èŠ§ç¶æ³ãªã©ã®è©³çŽ°ãææ¡ããããã«å¿
èŠãªç²åºŠã® Amazon SES ã®ã¡ãŒã«éä¿¡ã€ãã³ããç£èŠããæ¹æ³ã説æããŸãã çŸåšãE ã¡ãŒã«ããŒã±ã¿ãŒã¯ãã¥ãŒã¹ã¬ã¿ãŒãããã¢ãŒã·ã§ã³ã³ã³ãã³ããªã©ããã£ã³ããŒã³ãã³ãã¥ãã±ãŒã·ã§ã³æ¹æ³ãäœãããã«å
éšã¢ããªã±ãŒã·ã§ã³ã«äŸåããŠããŸãã ãããã®æŽ»åããã顧客ãšã®ããè¯ãã€ã³ã¿ã©ã¯ã·ã§ã³ãåŸãããã«ã¯ãŒã¯ãããŒãåæããŠæ¹åããããå€ãã®æ
å ±ãåéããå¿
èŠããããŸãã ããŠã³ã¹ãæåŠãåä¿¡æåãé
ä¿¡é
å»¶ãèŠæ
ãéå°çãªã©ã®ããŒã¿ã¯é¡§å®¢ãçè§£ããããã®åŒ·åãªããŒã«ãšãªããŸãã éåžžã®ã¢ããªã±ãŒã·ã§ã³ã¯ããã£ã³ããŒã³ã®å¹æãããé«ããããã®è©³çްãªãã°ãããŒã¿ãæäŸããŠããªããããé«ã¬ãã«ã®æ
å ±ããæ±ããŸããã Amazon Simple Email Service (SES ) ã¯èªèº«ã®è£œåã«ç°¡åã«çµ±åã§ããã³ã¹ãå¹çã®è¯ãæè»ã§ã¹ã±ãŒã©ãã«ãªã¡ãŒã«ãµãŒãã¹ãœãªã¥ãŒã·ã§ã³ãæ±ããäŒæ¥åãã®ããŒã«ã§ãã Amazon SES ã¯ãAmazon CloudWatch Metrics ãšã®çµã¿èŸŒã¿çµ±åã«ããé信掻åã管çã§ããæ©èœãæäŸããã¡ãŒã«éä¿¡ã€ãã³ãããŒã¿ãåéããã¡ã«ããºã ãæäŸããŸãã ãã®ããã°ã§ã¯ãéä¿¡ãé
ä¿¡ãéå°ãã¯ãªãã¯ãããŠã³ã¹ãèŠæ
ãæåŠãã¬ã³ããªã³ã°å€±æãé
ä¿¡é
å»¶ãªã©ããŸããŸãªçš®é¡ã®ã¡ãŒã«éä¿¡ã€ãã³ãã«å¯ŸããŠè©³çްã«ã¡ãŒã«éä¿¡ã¢ã¯ãã£ããã£ã远跡ããããã®ã¢ãŒããã¯ãã£ã𿮵éçãªã¬ã€ããææ¡ããŸãã Amazon SES ã® èšå®ã»ãã æ©èœã䜿çšããŠã詳现ãªãã°ãåæãµãŒãã¹ã«éä¿¡ããããã§ããŒã¿ãä¿åãã¯ãšãªã詳现ãªãã¥ãŒã®ããã·ã¥ããŒããäœæããŸãã ãœãªã¥ãŒã·ã§ã³ã®æŠèŠ ãã®ã¢ãŒããã¯ãã£ã§ã¯ãAmazon SES ã®çµã¿èŸŒã¿æ©èœãš AWS ã®åæãµãŒãã¹ãå©çšããŠãã¡ãŒã«è¿œè·¡ã®èŠä»¶ã«å¯Ÿããè¿
éãã€äœã³ã¹ãã®ãœãªã¥ãŒã·ã§ã³ãæäŸããŸãã 以äžã®ãµãŒãã¹ããæ§æãããŸãã Amazon Simple Email Service (SES) Amazon Simple Storage Service (S3) Amazon Kinesis Data Firehose Amazon Athena AWS Glue ããŒã¿ã«ã¿ãã° Amazon QuickSight 次ã®å³ã¯ãã®ãœãªã¥ãŒã·ã§ã³ã®ã¢ãŒããã¯ãã£ã瀺ããŠããŸãã å³ 1. Amazon SES ã€ãã³ããåæããããã®ãµãŒããŒã¬ã¹ã¢ãŒããã¯ã㣠ã客æ§ã Amazon SES ã䜿çšããŠã¡ãŒã«ãéä¿¡ãããšãã€ãã³ãã®ãããŒãéå§ãããŸãããããã®éä¿¡ã€ãã³ãã¯ãã¹ãŠãèšå®ã»ããæ©èœã«ãã£ãŠãã£ããã£ãããKinesis Firehose é
ä¿¡ã¹ããªãŒã ã«è»¢éãããŸããããã§ã€ãã³ãããããã¡ãããAmazon S3 ãã±ããã«ä¿åãããŸãã ã€ãã³ããä¿åããåŸãAmazon Athena ã S3 äžã®ãããã®ã€ãã³ããé©åã«ã¯ãšãªã§ããããã«ãããŒã¿ããŒã¹ãšããŒãã«ã¹ããŒããäœæããAWS Glue Data Catalog ã«æ ŒçŽããå¿
èŠããããŸãã æåŸã«ãAmazon QuickSight ã䜿çšããŠãã€ã³ã¿ã©ã¯ãã£ããªããã·ã¥ããŒããäœæããã¡ãŒã«ããšã®è©³çްæ
å ±ã瀺ããŠãéä¿¡ã¢ã¯ãã£ããã£å
šäœãæ€çŽ¢ããã³å¯èŠåããŸãã åææ¡ä»¶ ãã®ãŠã©ãŒã¯ã¹ã«ãŒãè¡ãã«ã¯ã以äžã®åææ¡ä»¶ãæºãããŠããå¿
èŠããããŸã: AWS ã¢ã«ãŠã³ã æ¬çªçšŒåã¢ã¯ã»ã¹ã® SES ãã¡ã€ã³ Amazon S3ãAmazon AthenaãAWS Glue Data CatalogãAmazon Kinesis FirehoseãAmazon QuickSight ãæ§æããããã®é©å㪠IAM ã®æš©é Author ãŠãŒã¶ãŒãäœæãã QuickSight ã€ã³ã¹ã¿ã³ã¹ ãŠã©ãŒã¯ã¹ã«ãŒ ã¹ããã 1: AWS CloudFormation ã䜿çšããŠã远å ã®åææ¡ä»¶ããããã€ãã AWS CloudFormation ã®ãµã³ãã«ãã³ãã¬ãŒã ã䜿ãã°ãåææ¡ä»¶ãããã€ãå«ããŠå§ããããŸãã ãã®ãã³ãã¬ãŒãã¯ãAmazon S3 ãã±ãããšãAmazon SES ãã Amazon Kinesis Data Firehose ã«ã¢ã¯ã»ã¹ããããã«å¿
èŠãª IAM ããŒã«ãäœæããŸãã CloudFormation ãã³ãã¬ãŒããããŠã³ããŒãããã«ã¯ãã䜿ãã® OS ã«å¿ããŠä»¥äžã®ã³ãã³ãã®ãããããå®è¡ããŠãã ãã: Windows ã®å Žå: curl https://raw.githubusercontent.com/aws-samples/amazon-ses-analytics-blog/main/SES-Blog-PreRequisites.yml -o SES-Blog-PreRequisites.yml MacOS ã®å Žå: wget https://raw.githubusercontent.com/aws-samples/amazon-ses-analytics-blog/main/SES-Blog-PreRequisites.yml ãã³ãã¬ãŒãããããã€ããã«ã¯ã次㮠AWS CLI ã³ãã³ãã䜿çšããŸã: aws cloudformation deploy --template-file ./SES-Blog-PreRequisites.yml --stack-name ses-dashboard-prerequisites --capabilities CAPABILITY_NAMED_IAM ãã³ãã¬ãŒãããªãœãŒã¹ã®äœæãå®äºãããšãã¹ã¿ãã¯ã®åºåã¿ãã« IAM ãµãŒãã¹ããŒã«ãšé
ä¿¡ã¹ããªãŒã ã衚瀺ãããŸãã ãããã®ãªãœãŒã¹ã¯æ¬¡ã®æé ã§äœ¿çšããŸãã å³ 2. CloudFormation ãã³ãã¬ãŒãã®åºå ã¹ããã 2: SES ã§èšå®ã»ãããäœæããæ€èšŒæžã¿ã® ID ã®ããã©ã«ãèšå®ã»ãããèšå®ãã SES ã¯ãéä¿¡ããã¡ãŒã«ããšã«éä¿¡ãé
ä¿¡ãéå°ãã¯ãªãã¯ãããŠã³ã¹ãèŠæ
ã®ã€ãã³ãæ°ã远跡ã§ããŸããã€ãã³ããããªãã·ã³ã°ã䜿çšãããšããããã®ã€ãã³ãã«é¢ããæ
å ±ãä»ã® AWS ãµãŒãã¹ã«éä¿¡ã§ããŸããä»åã¯ãã€ãã³ãã Kinesis Firehose ã«éä¿¡ããŸãããã®ããã«ã¯ãèšå®ã»ãããå¿
èŠã§ãã èšå®ã»ãããäœæããã«ã¯ã以äžã®æé ãå®è¡ããŠãã ãã: AWS ã³ã³ãœãŒã«ã§ã Amazon Simple Email Service ãéžæããŸãã Configuration sets ãéžæããŸãã Create set ãã¯ãªãã¯ããŸãã å³ 3. Amazon SES Create Configuration Set Configuration set name ãèšå®ããŸãã ä»ã®èšå®ã¯ããã©ã«ãã®ãŸãŸã«ããŠãããŸãã å³ 4. Configuration Set Name èšå®ã»ãããäœæããããã Event destinations ãéžæããŸãã å³ 5. Configuration set created successfully Add destination ãã¯ãªãã¯ããŸãã åæãããã€ãã³ãã¿ã€ããéžæãã next ãã¯ãªãã¯ããŸãã å³ 6. Sending Events to analyze å®å
ãšã㊠Amazon Kinesis Data Firehose ãéžæããåã«äœæããé
ä¿¡ã¹ããªãŒã ãš IAM ããŒã«ãéžæãã next ãã¯ãªãã¯ããŸããã¬ãã¥ãŒããŒãžã§ Add destination ãã¯ãªãã¯ããŸãã å³ 7. Destination for Amazon SES sending events èšå®ã»ãããšã€ãã³ãå®å
ãäœæããããæ€èšŒæžã¿ã® ID (ãã¡ã€ã³ãŸãã¯ã¡ãŒã«ã¢ãã¬ã¹) ã®ããã©ã«ãã®èšå®ã»ãããå®çŸ©ã§ããŸããSES ã³ã³ãœãŒã«ã§ Verified identities ãéžæããŸãã å³ 8 Amazon SES Verified Identity ã€ãã³ããåéããæ€èšŒæžã¿ã® ID ãéžæãã Configuration set ãéžæããŸãã Edit ãã¯ãªãã¯ããŸãã å³ 9. Edit Configuration Set for Verified Identity ããã©ã«ãã®èšå®ã»ãããå²ãåœãŠããã§ãã¯ããã¯ã¹ããªã³ã«ããåã«äœæããèšå®ã»ãããéžæããŸãã å³ 10. Assign default configuration set åã®æé ãå®äºãããšãã€ãã³ãã Amazon S3 ã«éä¿¡ãããŸããKinesis é
ä¿¡ã¹ããªãŒã ã®ãããã¡èšå®ã«ãããããŒã¿ã¯ 5 åããšãŸã㯠5 MiB ããšã« Amazon S3 ã«ããŒããããŸãããã±ããã«äœæãããæ§é ã確èªããSES ã€ãã³ãããŒã¿ã® JSON ãã°ã確èªã§ããŸãã å³ 11. Amazon S3 bucket structure ã¹ããã 3: Amazon Athena ã䜿çšã㊠SES ã€ãã³ããã°ãã¯ãšãªãã Amazon SES ã¯ãã¡ãŒã«éä¿¡ã€ãã³ãã¬ã³ãŒãã JSON 圢åŒã§ Amazon Kinesis Data Firehose ã«å
¬éããŸãã ãããã¬ãã«ã® JSON ãªããžã§ã¯ãã«ã¯ãeventType æååãmail ãªããžã§ã¯ããããã³ã€ãã³ãã®çš®é¡ã«å¿ã㊠BounceãComplaintãDeliveryãSendãRejectãOpenãClickãRendering FailureãDeliveryDelay ãªããžã§ã¯ããå«ãŸããŠããŸãã ã¡ãŒã«éä¿¡ã€ãã³ãã®åæãç°¡çŽ åããããã«ã次ã®ã¹ã¯ãªããã Amazon Athena ã§å®è¡ã㊠sesmaster ããŒãã«ãäœæããŸãã æ¬¡ã®ã¹ã¯ãªããã® LOCATION ãã¡ãŒã«éä¿¡ã€ãã³ãã®ããŒã¿ãå«ãèªåã®ãã±ããã«å€æŽããããšãå¿ããªãã§ãã ãã ã CREATE EXTERNAL TABLE sesmaster ( eventType string, complaint struct < arrivaldate: string, complainedrecipients: array < struct < emailaddress: string >>, complaintfeedbacktype: string, feedbackid: string, `timestamp`: string, useragent: string >, bounce struct < bouncedrecipients: array < struct < action: string, diagnosticcode: string, emailaddress: string, status: string >>, bouncesubtype: string, bouncetype: string, feedbackid: string, reportingmta: string, `timestamp`: string >, mail struct < timestamp: string, source: string, sourcearn: string, sendingaccountid: string, messageid: string, destination: string, headerstruncated: boolean, headers: array < struct < name: string, value: string >>, commonheaders: struct < `from`: array < string >, to: array < string >, messageid: string, subject: string >, tags: struct < ses_source_tls_version: string, ses_operation: string, ses_configurationset: string, ses_source_ip: string, ses_outgoing_ip: string, ses_from_domain: string, ses_caller_identity: string >>, send string, delivery struct < processingtimemillis: int, recipients: array < string >, reportingmta: string, smtpresponse: string, `timestamp`: string >, open struct < ipaddress: string, `timestamp`: string, userAgent: string >, reject struct < reason: string >, click struct < ipAddress: string, `timestamp`: string, userAgent: string, link: string > ) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' WITH SERDEPROPERTIES ( "mapping.ses_caller_identity" = "ses:caller-identity", "mapping.ses_configurationset" = "ses:configuration-set", "mapping.ses_from_domain" = "ses:from-domain", "mapping.ses_operation" = "ses:opeation", "mapping.ses_outgoing_ip" = "ses:outgoing-ip", "mapping.ses_source_ip" = "ses:source-ip", "mapping.ses_source_tls_version" = "ses:source-tls-version" ) LOCATION 's3://aws-s3-ses-analytics-<aws-account-number>/' sesmaster ããŒãã«ã¯ã org.openx.data.jsonserde.JsonSerDe SerDe ã©ã€ãã©ãªã䜿çšã㊠JSON ããŒã¿ãéã·ãªã¢ã«åããŸãã JSON é
åãšãããã®ãµããŒããããã³ãã¹ããããããŒã¿æ§é ã®ãµããŒããæŽ»çšããŠããŸãããããã®æ©èœã«ãããããŒã¿ã®æºåãšå¯èŠåã®ããã»ã¹ã容æã«ãªããŸãã sesmaster ããŒãã«ã§ã¯ã次ã®ãããã³ã°ãé©çšãããŠãããã³ãã³ãå«ã JSON ãã£ãŒã«ãåã«ãããšã©ãŒãåé¿ããŠããŸãã âmapping.ses_configurationsetâ=âses:configuration-setâ âmapping.ses_source_ipâ=âses:source-ipâ âmapping.ses_from_domainâ=âses:from-domainâ âmapping.ses_caller_identityâ=âses:caller-identityâ âmapping.ses_outgoing_ipâ=âses:outgoing-ipâ sesmaster ããŒãã«ãæºåã§ãããããã®ããŒã¿ã®æŽçããããã¥ãŒãäœæããã®ãè¯ãæŠç¥ã§ããæåã®ãã¥ãŒ vwSESMaster ã«ã¯ãã¡ãŒã«éä¿¡ã€ãã³ãã®ãã¹ãŠã®ã¬ã³ãŒããšãåã€ãã³ãã§äžæã®ãã¹ãŠã®ãã£ãŒã«ããå«ãŸããŠããŸããæ¬¡ã®ã¹ã¯ãªããã Amazon Athena ã§å®è¡ããŠãvwSESMaster ãã¥ãŒãäœæããŸãã CREATE OR REPLACE VIEW vwSESMaster AS SELECT eventtype as eventtype , mail.messageId as mailmessageid , mail.timestamp as mailtimestamp , mail.source as mailsource , mail.sendingAccountId as mailsendingAccountId , mail.commonHeaders.subject as mailsubject , mail.tags.ses_configurationset as mailses_configurationset , mail.tags.ses_source_ip as mailses_source_ip , mail.tags.ses_from_domain as mailses_from_domain , mail.tags.ses_outgoing_ip as mailses_outgoing_ip , delivery.processingtimemillis as deliveryprocessingtimemillis , delivery.reportingmta as deliveryreportingmta , delivery.smtpresponse as deliverysmtpresponse , delivery.timestamp as deliverytimestamp , delivery.recipients[1] as deliveryrecipient , open.ipaddress as openipaddress , open.timestamp as opentimestamp , open.userAgent as openuseragent , bounce.bounceType as bouncebounceType , bounce.bouncesubtype as bouncebouncesubtype , bounce.feedbackid as bouncefeedbackid , bounce.timestamp as bouncetimestamp , bounce.reportingMTA as bouncereportingmta , click.ipAddress as clickipaddress , click.timestamp as clicktimestamp , click.userAgent as clickuseragent , click.link as clicklink , complaint.timestamp as complainttimestamp , complaint.userAgent as complaintuseragent , complaint.complaintFeedbackType as complaintcomplaintfeedbacktype , complaint.arrivalDate as complaintarrivaldate , reject.reason as rejectreason FROM sesmaster sesmaster ããŒãã«ã«ã¯ããã¹ããããé
åã§è¡šãããŠãããã£ãŒã«ããããã€ããããããããããè€æ°ã®è¡ã«ãã©ããåããå¿
èŠããããŸããæ¬¡ã«ãã€ãã³ãã¿ã€ããšãã©ããåãå¿
èŠãªãã£ãŒã«ãã瀺ããŸãã ã€ãã³ãã¿ã€ã SEND: ãã£ãŒã«ã mail.commonHeaders ã€ãã³ãã¿ã€ã BOUNCE: ãã£ãŒã«ã bounce.bouncedrecipients ã€ãã³ãã¿ã€ã COMPLAINT: ãã£ãŒã«ã complaint.complainedrecipients ãããã®é
åãè€æ°ã®è¡ã«ãã©ããåããããã«ãCROSS JOIN ãš UNNEST æŒç®åãæ¬¡ã®æŠç¥ã§äœ¿çšããŸããã mail.messageID ãšãã©ããåãããã£ãŒã«ããå«ãäžæãã¥ãŒãäœæããŸãã é
åãè€æ°ã®è¡ã«ãã©ããåããå¥ã®äžæãã¥ãŒãäœæããŸãã sesmaster ããŒãã«ãš 2 çªç®ã®äžæãã¥ãŒãã€ãã³ãã¿ã€ããš mail.messageID ã§çµåããŠãæçµãã¥ãŒãäœæããŸãã ãããã®ãã¥ãŒãäœæããã«ã¯ãæ¬¡ã®æé ã«åŸã£ãŠãã ããã æ¬¡ã®ã¹ã¯ãªããã Amazon Athena ã§å®è¡ããŠãSEND ã€ãã³ãã¿ã€ãã® mail.commonHeaders é
åããã©ããåããŸãã CREATE OR REPLACE VIEW vwSendMailTmpSendTo AS SELECT mail.messageId as messageid , mail.commonHeaders.to as recipients FROM sesmaster WHERE eventtype='Send' CREATE OR REPLACE VIEW vwsendmailrecipients AS SELECT messageid , recipient FROM ("vwSendMailTmpSendTo" CROSS JOIN UNNEST(recipients) t (recipient)) CREATE OR REPLACE VIEW vwSentMails AS SELECT eventtype as eventtype , mail.messageId as mailmessageid , mail.timestamp as mailtimestamp , mail.source as mailsource , mail.sendingAccountId as mailsendingAccountId , mail.commonHeaders.subject as mailsubject , mail.tags.ses_configurationset as mailses_configurationset , mail.tags.ses_source_ip as mailses_source_ip , mail.tags.ses_from_domain as mailses_from_domain , mail.tags.ses_outgoing_ip as mailses_outgoing_ip , dest.recipient as mailto FROM sesmaster as sm ,vwsendmailrecipients as dest WHERE sm.eventtype = 'Send' and sm.mail.messageid = dest.messageid 次ã®ã¹ã¯ãªããã Amazon Athena ã§å®è¡ããŠãBOUNCE ã€ãã³ãã¿ã€ãã® bounce.bouncedrecipients é
åããã©ããåããŸãã CREATE OR REPLACE VIEW vwbouncemailtmprecipients AS SELECT mail.messageId as messageid , bounce.bouncedrecipients FROM sesmaster WHERE (eventtype = 'Bounce') CREATE OR REPLACE VIEW vwbouncemailrecipients AS SELECT messageid , recipient.action , recipient.diagnosticcode , recipient.emailaddress FROM (vwbouncemailtmprecipients CROSS JOIN UNNEST(bouncedrecipients) t (recipient)) CREATE OR REPLACE VIEW vwBouncedMails AS SELECT eventtype as eventtype , mail.messageId as mailmessageid , mail.timestamp as mailtimestamp , mail.source as mailsource , mail.sendingAccountId as mailsendingAccountId , mail.commonHeaders.subject as mailsubject , mail.tags.ses_configurationset as mailses_configurationset , mail.tags.ses_source_ip as mailses_source_ip , mail.tags.ses_from_domain as mailses_from_domain , mail.tags.ses_outgoing_ip as mailses_outgoing_ip , bounce.bounceType as bouncebounceType , bounce.bouncesubtype as bouncebouncesubtype , bounce.feedbackid as bouncefeedbackid , bounce.timestamp as bouncetimestamp , bounce.reportingMTA as bouncereportingmta , bd.action as bounceaction , bd.diagnosticcode as bouncediagnosticcode , bd.emailaddress as bounceemailaddress FROM sesmaster as sm ,vwbouncemailrecipients as bd WHERE sm.eventtype = 'Bounce' and sm.mail.messageid = bd.messageid 次ã®ã¹ã¯ãªããã Amazon Athena ã§å®è¡ããŠãCOMPLAINT ã€ãã³ãã¿ã€ãã® complaint.complainedrecipients é
åããã©ããåããŸãã CREATE OR REPLACE VIEW vwcomplainttmprecipients AS SELECT mail.messageId as messageid , complaint.complainedrecipients FROM sesmaster WHERE (eventtype = 'Complaint') CREATE OR REPLACE VIEW vwcomplainedrecipients AS SELECT messageid , recipient.emailaddress FROM (vwcomplainttmprecipients CROSS JOIN UNNEST(complainedrecipients) t (recipient)) ã¡ãŒã«éä¿¡ã€ãã³ããåæããããã« Amazon QuickSight ã§äœ¿çšã§ãã以äžã® 4 ã€ã®ããŒãã«ãš 1 ã€ã®ãã¥ãŒããããŸãã ããŒãã«: sesmaster ãã¥ãŒ: vwSESMaster ãã¥ãŒ: vwSentMails ãã¥ãŒ: vwBouncedMails ãã¥ãŒ: vwComplainedemails ã¹ããã 4: Amazon QuickSight ã䜿çšããŠããŒã¿ãåæããå¯èŠåãã Amazon QuickSight ã䜿çšããŠãäžè¿°ãã sesmaster ããŒãã« ãš 4 ã€ã®ãã¥ãŒããã¡ãŒã«éä¿¡ã€ãã³ããåæããå¯èŠåããŸãã Amazon QuickSight 㯠Athena ãéããŠããŒã¿ã«çŽæ¥ã¢ã¯ã»ã¹ã§ããŸãã ã»ãã·ã§ã³ããšã®èª²éäœç³»ã§ãããçµç¹å
ã®å
šå¡ã«åæã®ã€ã³ãµã€ããæäŸã§ããŸãã ãŸãã¯ã»ããã¢ããããŸããããæåã« Athena ã§æ°ããããŒã¿ãœãŒã¹ãäœæããããã®ããŒãã«ãšãã¥ãŒãéžæããŸãããããããŠããããã®ããŒã¿ãœãŒã¹ã䜿ã£ãŠå¯èŠåããŠãããŸããããããã§ã¯å¯èŠåã®äŸãäœæããŸããæ
å ±ããŒãºã«åºã¥ããŠãç¬èªã®å¯èŠåãäœæããŠãã ããã Amazon QuickSight ã§ããŒã¿ã䜿çšããåã«ããŸãåºç€ãšãªã S3 ãã±ãããžã®ã¢ã¯ã»ã¹ãèš±å¯ããå¿
èŠããããŸããä»ã®åæã§ãŸã è¡ã£ãŠããªãå Žåã¯ããã®æ¹æ³ã«ã€ããŠã®ããã¥ã¡ã³ããåç
§ããŠãã ããã Amazon QuickSight ã®ããŒã ããŒãžã§ãå·ŠåŽã®ã¡ãã¥ãŒãã Datasets ãéžæããå³äžã® New dataset ãéžæããŸããããŒã¿ãœãŒã¹ãšã㊠Athena ãèšå®ãéžæããŸããæ¬¡ã®ãã€ã¢ãã°ããã¯ã¹ã§ãããŒã¿ãœãŒã¹ã«åãããããååãä»ããŠãããŒã¿ãœãŒã¹ã®äœæãéžæããŸãã å³ 12. æ°ãã Athena ããŒã¿ãœãŒã¹ã®äœæ 次ã®ãã€ã¢ãã°ããã¯ã¹ã§ãsesmaster ãšå å·¥æžã¿ãã¥ãŒãå«ã Catalog ãš Database ãéžæããŸããåºæ¬ç㪠KPI (Key Performance Indicators) ãäœæããããã«ãsesmaster ããŒãã«ãéžæãã Select ãã¯ãªãã¯ããŸãã å³ 13. Sesmaster ããŒãã«ã®éžæ sesmaster ããŒãã«ã Amazon QuickSight ã®ããŒã¿ãœãŒã¹ã«ãªããŸãããæ¬¡ã¯ããŒã¿ã®å¯èŠåã«ç§»ããŸãã å³ 14. QuickSight ã§ã®ããŒã¿å¯èŠå å·ŠåŽã«ãã£ãŒã«ãã®ãªã¹ãã衚瀺ãããŠããŸããå³åŽã®ãã£ã³ãã¹ã¯ãŸã 空çœã§ããããŒã¿ã远å ããåã«ã å©çšå¯èœãªããžã¥ã¢ã«ã¿ã€ã ãã KPI ãéžæããŸãã å³ 15. QuickSight ã®ããžã¥ã¢ã«ã¿ã€ã ã°ã©ãã«ããŒã¿ã远å ããã«ã¯ãå·ŠåŽã®ãã£ãŒã«ããªã¹ããããã£ãŒã«ãããã©ãã°&ããããããŠãããããã®é åã«é
眮ããŸããä»åã¯ããã£ãŒã«ã send ãå€ã®é åã«é
眮ããéèšã« count ã䜿çšããŸãã å³ 16. Send ãã£ãŒã«ãã®å¯èŠåãžã®è¿œå å·Šäžããæ°ããããžã¥ã¢ã«ã远å ããããžã¥ã¢ã«ã¿ã€ãã« KPI ãéžæããŸãã å³ 17. æ°ããããžã¥ã¢ã«ã®è¿œå å³ 18. KPI ã®ããžã¥ã¢ã«ã¿ã€ã ãã£ãŒã«ã Delivery ãå€ã®é åã«é
眮ããéèšã« count ã䜿çšããŸãã å³ 19. Delivery ãã£ãŒã«ãã®å¯èŠåãžã®è¿œå åæ§ã®æé (ã¹ããã 1 ãã 4) ãç¹°ãè¿ããOpenãClickãBounceãComplaintãReject ã€ãã³ãã®æ°ãã«ãŠã³ãããŸããæåŸã«ã次ã®ãããªå¯èŠåã衚瀺ãããã¯ãã§ããããžã¥ã¢ã«ã®ãµã€ãºã倿ŽããŠäžŠã¹æ¿ãããšãäžã®ç»åã®ãããªåæçµæãåŸãããŸãã å³ 20. KPI ã®ãã¬ãã¥ãŒ çŸåšã®ããŒã¿ã»ããã®å³åŽã«ããéçã¢ã€ã³ã³ãã¯ãªãã¯ããŠãæ°ããããŒã¿ã»ããã远å ããŸãã å³ 21. æ°ããããŒã¿ã»ããã®è¿œå 次ã®ãã€ã¢ãã°ããã¯ã¹ã§ Add Dataset ãéžæããŸãã å³ 22. æ°ããããŒã¿ã»ããã®è¿œå vwsesmaster ãšåŒã°ãããã¥ãŒãéžæãã Select ãã¯ãªãã¯ããŸãã å³ 23. vwsesmaster ããŒã¿ã»ããã®è¿œå vwsesmaster ãã¥ãŒã®å©çšå¯èœãªãã£ãŒã«ãããã¹ãŠè¡šç€ºãããŸãã å³ 24. vwsesmaster ããŒã¿ã»ããã®æ°ãããã£ãŒã«ã æ°ããããžã¥ã¢ã«ãäœæããããžã¥ã¢ã«ã¿ã€ãã«è¡šãéžæããŸãã å³ 25. QuickSight ã®ããžã¥ã¢ã«ã¿ã€ã å·ŠåŽã®ãã£ãŒã«ããªã¹ããããã£ãŒã«ãããã©ãã°&ããããããŠãããããã®é åã«é
眮ããŸããä»åã¯ããã£ãŒã«ã eventtypeãmailmessageidãmailsubject ã ã°ã«ãŒãåã®é åã«é
眮ããŸãããå¿
èŠã«å¿ããŠããã«ãã£ãŒã«ãã远å ã§ããŸãã å³ 26. eventtypeãmailmessageidãmailsubject ãã£ãŒã«ãã®è¿œå 次ã«ããã®ããžã¥ã¢ã«ã«ã€ãã³ãã¿ã€ãã§ãã£ã«ã¿ãªã³ã°ãããã£ã«ã¿ãŒãäœæããŸãããŸããããŒãã«ãéžæããå·ŠåŽã®ã¡ãã¥ãŒãããã£ã«ã¿ãŒãéžæããŸãã Create One ãã¯ãªãã¯ãããããã¢ãããŠã£ã³ããŠã§ãã£ãŒã«ã eventtype ãéžæããŸããæ¬¡ã«ãeventtype ãã£ã«ã¿ãŒãéžæãããšã次ã®ãªãã·ã§ã³ã衚瀺ãããŸãã å³ 28. eventtype ãã£ã«ã¿ãŒã®äœæ eventtype ãã£ã«ã¿ãŒã®å³åŽã®ç¹ãã¯ãªãã¯ãã Add to Sheet ãéžæããŸãã å³ 29. ãã£ã«ã¿ãŒã®ã·ãŒããžã®è¿œå ãã¹ãŠã®ããã©ã«ãå€ããã®ãŸãŸã«ããŠãäžã«ã¹ã¯ããŒã«ã㊠Apply ãéžæããŸãã å³ 30. ããã©ã«ãå€ã§ãã£ã«ã¿ãŒãé©çš ããã§ãvwsesmaster ãã¥ãŒã eventtype ã§ãã£ã«ã¿ãŒã§ããŸãã å³ 31. eventtype ã§ vwsesmasterview ããã£ã«ã¿ãŒ sesmaster ããŒãã«ãvwsesmaster ãã¥ãŒã§å©çšå¯èœãªãã¹ãŠã®ããŒã¿ã䜿çšããŠå¯èŠåãã«ã¹ã¿ãã€ãºãç¶ããããšãã§ããŸããããã«ãvwSentMailsãvwBouncedMailsãvwComplainedemails ãã¥ãŒã®ããŒã¿ãå«ããããã«ããŒã¿ã»ããã远å ããããšãã§ããŸãã以äžã«ããããã®ãã¥ãŒããäœæãããä»ã®å¯èŠåãããã€ã瀺ããŸãã å³ 32. æçµçãªèŠèŠå 1 å³ 33. æçµçãªèŠèŠå 2 å³ 34. æçµçãªèŠèŠå 3 ã¯ãªãŒã³ã¢ãã ãã®ããã°ã§äœæãããªãœãŒã¹ãåé€ããŠãç¶ç¶çãªèª²éãé¿ããŠãã ããã Amazon QuickSight ã§äœæããå¯èŠåãåé€ããã ä»ã®ãããžã§ã¯ãã§ Amazon QuickSight ã䜿çšããŠããªãå Žåã¯ããµãã¹ã¯ãªãã·ã§ã³ãè§£é€ããã Amazon Athena ã§äœæãããã¥ãŒãšããŒãã«ãåé€ããã Amazon SES ã®èšå®ã»ãããåé€ããã S3 ãã±ããã«ãã°ãšããŠä¿åãããŠãã Amazon SES ã®ã€ãã³ããåé€ããã Amazon Kinesis Delivery Stream ãåé€ããããã«ãCloudFormation ã¹ã¿ãã¯ãåé€ããã çµè« ãã®ããã°ã§ã¯ãAmazon SES ã€ãã³ãã«åºã¥ããŠã¡ãŒã«è¿œè·¡ãœãªã¥ãŒã·ã§ã³ãè¿
éã«äœæããæ¹æ³ããAWS ã®ãµãŒãã¹ããã³æ©èœã䜿ã£ãŠç€ºããŸããã ãã®ãœãªã¥ãŒã·ã§ã³ã¯ããµãŒããŒã¬ã¹ã¢ãŒããã¯ãã£ãå®å
šã«æ¡çšããŠãããããã€ã³ãã©ã管çããå¿
èŠããªããAmazon SES ã®äœ¿çšéãå°ãªããŠãå€ããŠãããµãŒããŒãæ°ã«ããããšãªãæè»ã«ãœãªã¥ãŒã·ã§ã³ãå©çšã§ããŸãã æã
ã¯ãã»ãšãã©ã®ã客æ§ã®èŠä»¶ã«å¯Ÿå¿ããããã·ã¥ããŒããšåæã®ãµã³ãã«ãããã€ã玹ä»ããŸããããããããã®ãœãªã¥ãŒã·ã§ã³ãçºå±ãããããã·ã¥ããŒãã«ãã£ãŒãããã£ã«ã¿ãŒãã€ãã³ãã远å ãããåé€ããããããªã©ãããŒãºã«åãããŠã«ã¹ã¿ãã€ãºããããšãã§ããŸããAmazon SES ã®å©çšå¯èœãªã€ãã³ãããã®æ§é ãããã³ Amazon QuickSight ã§ã®ããã·ã¥ããŒããšåæã®äœææ¹æ³ã«ã€ããŠã¯ã次ã®ããã¥ã¡ã³ããåç
§ããŠãã ããã Amazon SES ã Amazon SNS ã«å
¬éããã€ãã³ãããŒã¿ã®å
容 ã¯ã€ãã¯ã¹ã¿ãŒã: ãµã³ãã«ããŒã¿ã䜿çšã㊠1 ã€ã®ããžã¥ã¢ã«ã§ Amazon QuickSight åæãäœæãã ããã©ãŒãã³ã¹ãšã³ã¹ãå¹çã®èгç¹ããããã®è§£æ±ºçãæ¹åããããã®èšå®ãããã€ããããŸãã ããšãã°ãparquet ãªã©ã®å圢åŒã®ãã¡ã€ã«ãã©ãŒãããã䜿çšããããSnappy ã§å§çž®ããããã¡ãŒã«éä¿¡ã®äœ¿çšç¶æ³ã«å¿ã㊠S3 ã®ããŒãã£ã·ã§ã³æŠç¥ãèšå®ãããããããšãã§ããŸãã å¥ã®æ¹åç¹ãšããŠãAmazon QuickSight ã§ããŒã¿ãèªã¿åãããã« SPICE ã«ããŒã¿ãã€ã³ããŒãããããšãèããããŸãã SPICE ã䜿çšãããšãAthena ããããŒã¿ã 1 åã ãããŒããããæåã§æŽæ°ãããã¹ã±ãžã¥ãŒã«ã䜿çšããŠèªåçã«æŽæ°ããããŸã§ãã£ãã·ã¥ãããŸãã ãã®ãŠã©ãŒã¯ã¹ã«ãŒã䜿çšããŠãæåã® SES ããã·ã¥ããŒããæ§æããã€ãã³ãã®è©³çްãå¯èŠåããããšãã§ããŸãããã®ããã°ã§èª¬æãããŠãããµãŒãã¹ã¯èŠä»¶ã«å¿ããŠèª¿æŽã§ããŸãã èè
ã«ã€ã㊠Oscar Mendoza is a Solutions Architect at AWS based in Bogotá, Colombia . Oscar works with our customers to provide guidance in architectural best practices and to build Well Architected solutions on the AWS platform. He enjoys spending time with his family and his dog and playing music. Luis Eduardo Torres is a Solutions Architect at AWS based in Bogotá, Colombia. He helps companies to build their business using the AWS cloud platform. He has a great interest in Analytics and has been leading the Analytics track of AWS Podcast in Spanish. Santiago BenavÃdez is a Solutions Architect at AWS based in Buenos Aires, Argentina, with more than 13 years of experience in IT, currently helping DNB/ISV customers to achieve their business goals using the breadth and depth of AWS services, designing highly available, resilient and cost-effective architectures. æ¬èšäºã¯ã Analyzing Amazon SES event data with AWS Analytics Services ã翻蚳ãããã®ã§ãã翻蚳㯠Solutions Architect ã® æŸå²¡åä¹ ãæ
åœããŸããã