2 Answers
- Newest
- Most votes
- Most comments
6
How about this:
- Tag Emails with Configuration Sets • Create a Configuration Set per client, or use a shared one with custom headers or message tags. • Use X-Client-ID or SES messageTags to identify which client each email belongs to.
- Stream Events to S3 • In your Configuration Set, set up an Event Destination to S3.
{
"eventType": "Send",
"mail": {
"timestamp": "2025-09-01T12:00:00.000Z",
"messageId": "abc123",
"tags": {
"ClientID": ["clientA"]
}
}
}
- Query the Data with Athena • Use Amazon Athena to query the S3 bucket directly. • Create a table that maps to your SES JSON structure.
SELECT
mail.tags.ClientID[1] AS client,
COUNT(*) AS total_sent
FROM ses_events
WHERE eventType = 'Send'
AND mail.timestamp BETWEEN date '2025-09-01' AND date '2025-09-30'
GROUP BY client
This gives you monthly stats per client. 4. Visualize or Export • Use Amazon QuickSight to build dashboards • Or export results to CSV and email them monthly
0
So I have been trying to implement your answer, but I am stuck on the Athena part. I get the error "Queries of this type are not supported."
SELECT
mail.source AS sending_email,
COUNT(*) AS total_events
FROM `ses-analitics`.`ses_events_detailed`
WHERE year = '2025' AND month = '09'
GROUP BY mail.source
ORDER BY total_events DESC
I have tried to describe the table and every other thing, but when I want to use the data, I get that error. For example, I get the same error with this code.
SELECT *
FROM `ses-analitics`.`ses_events_detailed`
LIMIT 10
I tried searching for the solution, but no luck so far
answered 10 months ago
Relevant content
asked 4 years ago
asked 4 years ago
asked 3 years ago
- AWS OFFICIALUpdated a year ago

So I have been trying to implement your answer, but I am stuck on the Athena part. I get the error "Queries of this type are not supported."
I have tried to describe the table and every other thing, but when I want to use the data, I get that error. For example, I get the same error with this code.
I tried searching for the solution, but no luck so far