Skip to content

Commit c1476e6

Browse files
committed
update
1 parent a51437a commit c1476e6

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

tinybird/datasources/mailgun.datasource

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,21 @@ TOKEN "append" APPEND
55
TAGS "mailgun"
66

77
SCHEMA >
8-
`date` DateTime `json:$.timestamp` DEFAULT now(),
9-
`record` JSON `json:$` DEFAULT '{}'
8+
`date` DateTime `json:$.event-data.timestamp` DEFAULT now(),
9+
`event` LowCardinality(String) `json:$.event-data.event` DEFAULT '',
10+
`message_id` String `json:$.event-data.message.headers.message-id` DEFAULT '',
11+
`recipient` String `json:$.event-data.recipient` DEFAULT '',
12+
`recipient_domain` String `json:$.event-data.recipient-domain` DEFAULT '',
13+
`tags` Array(String) `json:$.event-data.tags[:]` DEFAULT [],
14+
`log_level` LowCardinality(String) `json:$.event-data.log-level` DEFAULT '',
15+
`city` String `json:$.event-data.geolocation.city` DEFAULT '',
16+
`country` String `json:$.event-data.geolocation.country` DEFAULT '',
17+
`region` String `json:$.event-data.geolocation.region` DEFAULT '',
18+
`client_info` JSON `json:$.event-data.client-info` DEFAULT '{}',
19+
`delivery_status` JSON `json:$.event-data.delivery-status` DEFAULT '{}',
20+
`envelope` JSON `json:$.event-data.envelope` DEFAULT '{}',
21+
`user_variables` JSON `json:$.event-data.user-variables` DEFAULT '{}'
1022

1123
ENGINE "MergeTree"
1224
ENGINE_PARTITION_KEY "toYYYYMM(date)"
13-
ENGINE_SORTING_KEY "date"
25+
ENGINE_SORTING_KEY "event, date"

0 commit comments

Comments
 (0)