Skip to content

Commit b605238

Browse files
committed
add mailgun
1 parent 9b1e78e commit b605238

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
TOKEN "append" APPEND
2+
3+
# Refer to https://mailgun-docs.redoc.ly/docs/mailgun/user-manual/events/#event-structure
4+
5+
TAGS "mailgun"
6+
7+
SCHEMA >
8+
`date` DateTime `json:$.record.event-data.timestamp`,
9+
`event` LowCardinality(String) `json:$.record.event-data.event`,
10+
`message_id` String `json:$.record.event-data.message.headers.message-id` DEFAULT '',
11+
`recipient` String `json:$.record.event-data.recipient`,
12+
`recipient_domain` String `json:$.record.event-data.recipient-domain`,
13+
`tags` Array(String) `json:$.record.event-data.tags`,
14+
`log_level` LowCardinality(String) `json:$.record.event-data.log-level`,
15+
`city` String `json:$.record.event-data.geolocation.city` DEFAULT '',
16+
`country` String `json:$.record.event-data.geolocation.country` DEFAULT '',
17+
`region` String `json:$.record.event-data.geolocation.region` DEFAULT '',
18+
`client_info` JSON `json:$.record.event-data.client-info` DEFAULT '{}',
19+
`delivery_status` JSON `json:$.record.event-data.delivery-status` DEFAULT '{}',
20+
`envelope` JSON `json:$.record.event-data.envelope` DEFAULT '{}',
21+
`user_variables` JSON `json:$.record.event-data.user-variables` DEFAULT '{}'
22+
23+
ENGINE "MergeTree"
24+
ENGINE_PARTITION_KEY "toYYYYMM(timestamp)"
25+
ENGINE_SORTING_KEY "event, timestamp"

0 commit comments

Comments
 (0)