@@ -5,9 +5,21 @@ TOKEN "append" APPEND
55TAGS "mailgun"
66
77SCHEMA >
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
1123ENGINE "MergeTree"
1224ENGINE_PARTITION_KEY "toYYYYMM(date)"
13- ENGINE_SORTING_KEY "date"
25+ ENGINE_SORTING_KEY "event, date"
0 commit comments