Added missing schema to ch cluster

This commit is contained in:
Matteo Biscosi 2024-11-05 14:34:42 +01:00
parent df4344273c
commit 6ab628cab9

View file

@ -693,3 +693,22 @@ LEFT JOIN `mitre_table_info` AS mitre
ON (mitre.ENTITY_ID = 4 AND f.STATUS = mitre.ALERT_ID)
WHERE f.STATUS != 0
AND f.IS_ALERT_DELETED != 1;
@
CREATE TABLE IF NOT EXISTS `asset_management` (
`rowid` UUID DEFAULT generateUUIDv4(),
`type` String NOT NULL,
`key` String NOT NULL,
`ip` String NULL,
`mac` String NOT NULL,
`vlan` UInt16 NULL,
`network` UInt16 NULL,
`name` String NULL,
`device_type` UInt16 NULL,
`manufacturer` String NULL,
`first_seen` DateTime NOT NULL DEFAULT 0,
`last_seen` DateTime NOT NULL DEFAULT 0,
`trigger_alert` UInt8 MATERIALIZED IF(trigger_alert = 1, 1, 0),
`device_status` String NULL
) ENGINE = ReplacingMergeTree() PARTITION BY toYYYYMMDD(first_seen) ORDER BY (first_seen);