

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Athena를 사용하여 Amazon S3에 저장된 Amazon SNS 메시지 분석
<a name="firehose-message-analysis-s3"></a>

이 페이지에서는 전송 스트림을 통해 Amazon Simple Storage Service(Amazon S3) 대상으로 전송된 Amazon SNS 메시지를 분석하는 방법을 설명합니다.

**Firehose 전송 스트림을 통해 Amazon S3 대상으로 전송된 SNS 메시지를 분석하는 방법**

1. Amazon S3 리소스를 구성합니다. 지침은 *Amazon Simple Storage Service 사용 설명서*의 [버킷 생성](https://docs.aws.amazon.com/AmazonS3/latest/userguide/CreatingABucket.html) 및 *Amazon Simple Storage Service 사용 설명서*의 [Amazon S3 버킷 작업](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingBucket.html)을 참조하세요.

1. 전송 스트림을 구성합니다. 설명은 *Amazon Kinesis Data Firehose 개발자 안내서*의 [Amazon S3의 대상 선택](https://docs.aws.amazon.com/firehose/latest/dev/create-destination.html#create-destination-s3)을 참조하세요.

1. [Amazon Athena](https://console.aws.amazon.com/athena)를 사용하여 표준 SQL로 Amazon S3 객체를 쿼리합니다. 자세한 정보는 *Amazon Athena 사용 설명서*의 [시작하기](https://docs.aws.amazon.com/athena/latest/ug/getting-started.html)를 참조하세요.

## 쿼리 예
<a name="example-s3-query"></a>

이번 쿼리 예에서는 다음과 같이 가정합니다.
+ 메시지는 `default` 스키마의 `notifications` 테이블에 저장됩니다.
+ `notifications` 테이블에는 유형이 `string`인 `timestamp` 열이 포함되어 있습니다.

다음 쿼리는 지정된 날짜 범위에 수신된 모든 SNS 메시지를 반환합니다.

```
SELECT * 
FROM default.notifications
WHERE from_iso8601_timestamp(timestamp) BETWEEN TIMESTAMP '2020-12-01 00:00:00' AND TIMESTAMP '2020-12-02 00:00:00';
```